Skip to content

Sherlock Distributed Lock

Build Coverage Maven Central JavaDoc

Sherlock Distributed Lock Logo

Sherlock is a distributed locking library for JVM projects. It exposes both synchronous and reactive APIs (Reactor, RxJava, Kotlin Coroutines) and uses database connectors to store locks. It was created as a simple solution to manage distributed locks among microservices.

How it works?

Locks are acquired for a specific duration. When lock owning instance unexpectedly goes down, lock is automatically released after expiration.

Quick start

  • MongoDB - using sherlock with MongoDB
  • SQL - using sherlock with SQL databases
  • In-Memory - using in-memory Sherlock for local development or testing
  • Testing - stubbing and mocking Sherlock in unit tests
  • Migrator - using Sherlock as for database migration