Skip to content

This repository contains a working sample application to implement distributed locking using Redis.

Notifications You must be signed in to change notification settings

aayush03/redis-distributed-locking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

redis-distributed-locking

This repository contains a sample application to implement distributed locking using Redis along with support of using configurable environmental properties for parameterization of the DistributedLockable Annotation.

This has been built on top of the original article published on https://blog.piaoruiqing.com/

This can be used to acquire distributed locks through Redis over a specific key across all sentinels using the SETNX command implementation of Redis and uses Java lambdas to combine multiple statements of releasing the distributed lock and converts this process into an atomic operation and ensures correctness of the unlocking operation by not deleting someone else's lock.

Reference : https://redis.io/commands/setnx | https://developpaper.com/redis-distributed-lock/

Motivation

Implement idempotecy across multiple transactions for possible duplicate requests received from external systems corresponding to the same transaction id in a distributed systems environment.

About

This repository contains a working sample application to implement distributed locking using Redis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages