Distributed locking is a technique used to coordinate access to shared resources among multiple processes in a distributed system. The main objective is to ensure that only one process at a time can access a particular resource, preventing race conditions, data corruption, or inconsistency.
For implementation, we can use some solutions like :
Redis, uses libraries that implement lock algorithms like ShedLock, and Redisson. Using this is not advisable as discussed in (https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html)
Hazelcast offers a lock system based on its CP subsystem. (https://hazelcast.com/blog/long-live-distributed-locks/)
Zookeeper, I will be discussing this in detail below