Distributed System Lock Implementation using Redis and JAVA
The purpose of a lock is to ensure that among several application nodes that might try to do the same piece of work, only one actually does it (at least only one at a time).
5 min readMar 20, 2021
In current days I worked on Redis lock-in distributed system. In distributed system Locking/concurrency management is a very important thing. Without prior knowledge, many unwanted problems may occur.
What we will learn here
- Create a simple wallet backend with buggy architecture and code
- Create the Race condition and identify the problem
- Solve the problem using new architecture and implementation
- Share the codebase with file descriptions
Here I am sharing an application architecture. Suppose this is a bank wallet application backend. Its architecture is very simple. It has a single app server, single app node, single Redis server, and a single database