# lukas-krecan/ShedLock

Distributed lock for your scheduled tasks

Repository: https://github.com/lukas-krecan/ShedLock
Canonical: https://ross.abutalabs.com/products/shedlock
Language: Java
License: Apache-2.0
License Family: permissive
Last push: 2026-08-25T16:35:55+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 3552, "days_push": 8, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4211, forks 570 (observed 2026-08-28T04:08:39.103154+00:00)

## What it is
ShedLock is a Java library that ensures scheduled tasks are executed at most once at the same time across multiple nodes by acquiring time-based locks in an external store. It supports many lock providers including JDBC databases, Mongo, Redis, ZooKeeper, Hazelcast, and various cloud stores.

## Use cases
- prevent duplicate execution of scheduled tasks in a clustered app
- run cron jobs on multiple nodes but only once at a time
- distributed locking for Spring @Scheduled methods
- ensure a task runs on only one instance of a microservice
- coordinate background jobs across nodes using a database lock
- lock scheduled tasks with Redis or Mongo as the coordination store

## When to choose
- you have scheduled tasks that must not run in parallel across nodes
- you use Spring, Micronaut, or plain Java and need a lightweight lock, not a full scheduler
- you already have a database, Redis, or other supported store for coordination

## When to avoid
- you need a full distributed scheduler with queuing, retries, or job management - use db-scheduler or JobRunr
- your nodes' clocks are not synchronized, since locks are time-based
- you need tasks to wait for a lock rather than be skipped

## Facets
- artifact type: library
- maturity: stable
- function: scheduling, concurrency, middleware
- domain: microservices, backend, developer-tools
- platform: jvm
- tags: distributed-lock, scheduled-tasks, java, spring, micronaut, job-locking

## Member repositories
- lukas-krecan/ShedLock (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:39.103154+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:29.439978+00:00, confidence not recorded.
  - readme: https://github.com/lukas-krecan/ShedLock (fetched 2026-08-28T04:08:39.103154+00:00, sha c2f4f4efcf4e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
