Akka persistence eventual consistency settings

Hello, I have a question regarding akka.persistence.cassandra.events-by-tag.eventual-consistency-delay option:
In the reference.conf for this option it is written:

# Setting this to anything lower than 2s is highly discouraged.

At the same time if I open this page: https://doc.akka.io/docs/akka-persistence-cassandra/current/events-by-tag.html#tuning-for-lower-latency, there is an example of setting this option to 50ms:

akka.persistence.cassandra.events-by-tag.eventual-consistency-delay = 50ms

The question is: is it safe to set this value lower than 2s? Or there are some conditions when it can be set or cannot be set?

The linked tuning for lower latency also states, just above that low eventual-consistency-delay, which about sums it up:

You must test this has positive results for your use case. Setting this too low can decrease throughput and latency as more events will be missed initially and expensive searches carried out.

The root problem is guaranteeing a global order of tagged events in a distributed database where a node handling the query may not yet have seen written events from all other database nodes. Lower delay means higher risk of the node not having seen a new event from another node yet.

1 Like