Olric is a distributed, in-memory key/value store and cache written entirely in Go that can be deployed either as an embedded library within Go applications or as a standalone language-independent service. The project is designed specifically for distributed environments where multiple machines need to share a fast, scalable pool of RAM. It implements a distributed hash table with automatic data partitioning and rebalancing, eliminating the need for external coordination services. When new nodes join the cluster, they automatically discover peers and linearly increase the system's capacity while data and backups are automatically redistributed.
The system uses the Redis Serialization Protocol (RESP) for client communication, ensuring compatibility with Redis client libraries across nearly all major programming languages. This design choice allows Olric to serve as a drop-in replacement for Redis in many scenarios while providing distributed capabilities. The core use cases include distributed caching, managing application cluster state, and implementing publish-subscribe messaging patterns.
Olric provides extensive functionality through its distributed map implementation, supporting operations like PUT, GET, DEL, EXPIRE, and PEXPIRE for basic key-value operations. It includes atomic operations such as INCR, DECR, GETPUT, and CAS for concurrent-safe modifications. The system implements a locking primitive inspired by Redis's SETNX command, suitable for non-critical locking scenarios. Distributed map iteration is supported through a SCAN operation, and the publish-subscribe system includes SUBSCRIBE, PSUBSCRIBE, and related commands for messaging patterns.
The consistency model follows eventual consistency principles without claiming to be a complete CP solution, instead positioning itself as PA/EC according to the PACELC theorem. Olric supports replication by default with both synchronous and asynchronous options, using quorum-based voting for replica control with configurable read and write quorums. The system implements last-write-wins conflict resolution and includes read-repair mechanisms on distributed maps. Split-brain protection is provided through simple mechanisms, and the storage engine is designed to be garbage collection friendly with O(1) lookup performance.
Eviction policies include LRU, TTL-based expiration, and MaxIdleDuration mechanisms for managing memory in caching scenarios. The system distributes load fairly across cluster members using a consistent hash function and is thread-safe by default. Configuration can be managed both programmatically and declaratively through YAML files. Service discovery is pluggable, supporting static peer lists for development environments as well as integration with Consul, Kubernetes, and major cloud providers.
According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 1028.5 hours with a mean of 13817.9 hours across 34 tracked items. The most active labels are question (8 occurrences), enhancement (5), and bug (4). Primary contributor buraksezer has 79 tracked events, with sojadhav and AarshShah33 contributing 5 and 3 events respectively. The project is classified across multiple domains including distributed cache, in-memory grid, key-value store, pub/sub messaging, distributed locks, and high availability systems. The current production version is v0.7.0, and the module was renamed from github.com/buraksezer/olric to github.com/olric-data/olric starting with v0.6.0.