Reputation: 11
I've got a question regarding spring session with Redis backed implementation on the production environment. Due to performance reasons, we are wondering about using Redis in master/slave configuration with lettuces readFrom SLAVE_PREFFERED. But I'm still wondering about eventual consistency problem. Is it a problem in the spring session context, using lettuces RedisStaticMasterReplicaConfiguration?
In Redis docs, I've read that it is possible to have inconsistent data (master wrote something and slave didn't receive the update yet). I am working with a quite big throughput so after we saved some params in session or after user's logging in, I can imagine that some of the changes weren't propagated to slave, and next clients requests should make use of it, but didn't - because they weren't received by slave just yet. I couldn't synthesize this error on my own, but I imagine that it could be a problem with an extreme load. Have anybody had this kind of problems? Is it a valid question?
Upvotes: 0
Views: 370
Reputation: 9102
AFAIK Redis does not support strong consistency. WAIT command does provide acknowledgement from specific number of replicas however there are caveats.
However WAIT is only able to ensure that there are the specified number of acknowledged copies in the other Redis instances, it does not turn a set of Redis instances into a CP system with strong consistency: acknowledged writes can still be lost during a fail-over, depending on the exact configuration of the Redis persistence. However with WAIT the probability of losing a write after a failure event is greatly reduced to certain hard to trigger failure modes.
Also the replication by default being asynchronous ( other option being using WAIT), there is always a possibility of replication delay in very high throughput cases.
Upvotes: 0