Distributed, in-memory key/value store and cache. It can be used as an embedded Go library and a language-independent service.
Distributed, in-memory key/value store and cache. It can be used as an embedded Go library and a language-independent service.
Distributed In-Memory Cache & Key/Value Store
Olric provides a simple way to create a fast, scalable, and shared pool of RAM across a cluster of machines. It's a distributed, in-memory key/value store and cache, written entirely in Go and designed specifically for distributed environments.
Flexible Deployment:
Key Features:
See Docker and Samples sections to get started!
Join our Discord server!
The current production version is v0.7.0
github.com/buraksezer/olric module has been renamed to github.com/olric-data/olric. This change has been effective since v0.6.0.
Importing previous versions should redirect you to the new repository, but you should change the import paths in your codebase as soon as possible.
There is no other difference between v0.5.7 and v0.6.0.
Olric is an eventually consistent, unordered key/value data store. It supports various eviction mechanisms for distributed caching implementations. Olric also provides publish-subscribe messaging, data replication, failure detection and simple anti-entropy services.
It's good at distributed caching and publish/subscribe messaging.
See the Architecture section to see details.
We have a few communication channels:
You should know that the issue tracker is only intended for bug reports and feature requests.
Software doesn't maintain itself. If you need support on complex topics or request new features, please consider sponsoring Olric.
Please see our AI Contribution Policy before raising any AI-generated PR or bug reports.
Manually written code and bug reports are strongly preferred because AI-generated content is often low-quality and hard to understand and maintain.
With a correctly configured Golang environment:
go install github.com/olric-data/olric/cmd/[email protected]Now you can start using Olric:
olric-server -c cmd/olric-server/olric-server-local.yamlSee the Configuration section to create your cluster properly.
You can launch olric-server Docker container by running the following command.
docker pull ghcr.io/olric-data/olric:latestThis command will pull olric-server Docker image and run a new Olric Instance. You should know that the container exposes
3320 and 3322 ports.
Now, you can access an Olric cluster using any Redis client including redis-cli:
redis-cli -p 3320
127.0.0.1:3320> DM.PUT my-dmap my-key "Olric Rocks!"
OK
127.0.0.1:3320> DM.GET my-dmap my-key
"Olric Rocks!"
127.0.0.1:3320>With olric-server, you can create an Olric cluster with a few commands. This is how to install olric-server:
go install github.com/olric-data/olric/cmd/[email protected]Let's create a cluster with the following:
olric-server -c <YOUR_CONFIG_FILE_PATH>You can find the sample configuration file under cmd/olric-server/olric-server-local.yaml. It can perfectly run with single node.
olric-server also supports OLRIC_SERVER_CONFIG environment variable to set configuration. Just like that:
OLRIC_SERVER_CONFIG=<YOUR_CONFIG_FILE_PATH> olric-serverOlric uses hashicorp/memberlist for failure detection and cluster membership. Currently, there are different ways to discover peers in a cluster. You can use a static list of nodes in your configuration. It's ideal for development and test environments. Olric also supports Consul, Kubernetes and all well-known cloud providers for service discovery. Please take a look at Service Discovery section for further information.
See Client-Server section to get more information about this deployment scenario.
Basically, there is a list of nodes under memberlist block in the configuration file. In order to create an Olric cluster,
you just need to add Host:Port pairs of the other nodes. Please note that the Port is the memberlist port of the peer.
It is 3322 by default.
memberlist:
peers:
- "localhost:3322"Thanks to hashicorp/memberlist, Olric nodes can share the full list of members with each other. So an Olric node can discover the whole cluster by using a single member address.
See Samples section to learn how to embed Olric into your existing Golang application.
Olric has two different operation modes.
In Embedded Member Mode, members include both the application and Olric data and services. The advantage of the Embedded Member Mode is having a low-latency data access and locality.
In Client-Server Mode, Olric data and services are centralized in one or more servers, and they are accessed by the application through clients. You can have a cluster of servers that can be independently created and scaled. Your clients communicate with these members to reach to Olric data and services on them.
Client-Server deployment has advantages including more predictable and reliable performance, easier identification of problem causes and, most importantly, better scalability. When you need to scale in this deployment type, just add more Olric server members. You can address client and server scalability concerns separately.
The official Golang client is defined by the Client interface. T
No open issues yet, or sync has not completed.