DEV Community

Discussion on: Explain Redlock in Depth

Collapse
 
jhmilan profile image
Jose Milán • Edited

I have to disagree. The point with Redlock is specially about availability, which is the main issue if you use a consistent DB like MySQL or Mongo for distributed locks. I do use mongo for this as well but assuming that it becomes a single point of failure. Persistence in Redis is not s problem in this case. The solution has some pitfall, specially related to network partitions but not persistence. Regarding speed, in average our implementation takes 3ms per operation with 5 nodes and performing about 5k operations per minute, so I think it's quite nice.
Maintaining it also quite simple if you use kubernetes for example.

You advising against it for the reasons above is a bit too much in my opinion

Collapse
 
lazypro profile image
ChunTing Wu

That's fair.

My opinion has always been the complexity, and if your organization can afford it, then of course you can go with a relatively complex solution.

In fact, I do use Redlock on a limited number of occasions.

Collapse
 
jhmilan profile image
Jose Milán

Indeed. As usual there are no silver bullets for the problems we have and solutions really depend on the particularities. Redlock is indeed a bit more complex that a solution just based on Mongo.

Have a good day