A distributed cache service for managing mechanisms and reactions using Akka Distributed Data.
This service provides caching with consistency guarantees across multiple nodes in a cluster. It uses LWWMap (Last-Write-Wins Map) for conflict resolution and performs distributed read and write operations with configurable timeouts. Additionally, it leverages a local cache for optimised read-heavy workloads, reducing latency for frequently accessed data.
Type parameters
F
The effect type (e.g., IO, Future, etc.) used to encapsulate asynchronous computations in a functional manner.
Value parameters
distributedTtl
The timeout for distributed operations such as Get and Update in Akka Distributed Data. This defines how long the system will wait for responses in a distributed environment.
ec
The ExecutionContext used for handling asynchronous operations within the service. Ensures non-blocking execution of distributed reads and writes.
localTtlWithUnit
A tuple specifying the expiration duration for entries in the local cache. The tuple consists of an integer value representing the duration and a TimeUnit specifying the unit (e.g., minutes, seconds).
selfUniqueAddress
The unique address of the current node interacting with the cache. This address is used to identify updates and ensure correct state replication in the LWWMap.
system
The ActorSystem used for Akka operations, required to initialise the Distributed Data replicator. It enables communication and coordination across nodes in the cluster.