Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Is Redisson FairLock suitable for use in a Redis cluster?

$
0
0

I need a solution to ensure a resource gets locked across multiple Java servers. We already have a master/slave Redis cluster for reliability. I'd like to use FairLock because it seems simpler than RedLock which appears to require additional, separate Redis servers to be configured. However, it's unclear if FairLock is safe in a clustered Redis environment. Is RedLock the only option when you have multiple Redis servers?

For my purposes, the solution needs to: * Ensure exactly one thread across all my Java servers owns the lock and is allowed to make updates to the resource. In other words, I'm concerned with "correctness", not "efficiency".
* Locks should be automatically released if the client crashes (after a time) * If Redis servers fail, it should be in such a way that clients fail to obtain a lock rather than thinking they have a lock that they actually don't.

I see lots of documentation on "distributed locking" but it's unclear to me if the "distributed" refers to the clients or the servers or both.


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>