What is Embedded Olric

Olric is a distributed, in-memory object store. It’s designed from the ground up to be distributed, and it can be used both as an embedded Go library and as a language-independent service.

With Olric, you can instantly create a fast, scalable, shared pool of RAM across a cluster of computers.

Olric is implemented in Go and uses the Redis serialization protocol. So Olric has client implementations in all major programming languages.

Olric is highly scalable and available. Distributed applications can use it for distributed caching, clustering and publish-subscribe messaging.

Github repository

https://github.com/buraksezer/olric

Use Embedded Olric

With Caddy

You have to build your caddy instance including Souin and Embedded Olric using xcaddy (refer to the build caddy section).

  xcaddy build --with github.com/darkweak/souin/plugins/caddy --with github.com/darkweak/storages/olric/caddy
  

You will be able to use olric in your Caddyfile or JSON configuration file.

  {
    cache {
        ttl 1h
        olric
    }
}

route {
    cache
    respond "Hello HTTP cache"
}
  

Configuration

You can find the configuration for the Embedded Olric here or check the values table below.

Values

Key nametyperequired
Interfacestring
LogVerbosityint32
LogLevelstring
BindAddrstring
BindPortint
KeepAlivePeriodtime.Duration
IdleClosetime.Duration
BootstrapTimeouttime.Duration
RoutingTablePushIntervaltime.Duration
TriggerBalancerIntervaltime.Duration
Peers[]string
PartitionCountuint64
ReplicaCountint
ReadQuorumint
WriteQuorumint
MemberCountQuorumint32
ReadRepairbool
ReplicationModeint
LoadFactorfloat64
EnableClusterEventsChannelbool
JoinRetryIntervaltime.Duration
MaxJoinAttemptsint
MemberlistInterfacestring
LeaveTimeouttime.Duration