# samcook/RedLock.net

An implementation of the Redlock algorithm in C#

Repository: https://github.com/samcook/RedLock.net
Canonical: https://ross.abutalabs.com/products/redlocknet
Language: C#
License: MIT
License Family: permissive
Topics: redlock, c-sharp, redlock-algorithm, redis, distributed-locks, dotnet
Last push: 2024-06-24T18:26:53+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4388, "days_push": 800, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1050, forks 169 (observed 2026-08-28T04:03:23.035965+00:00)

## What it is
RedLock.net is a C# library implementing the Redlock distributed lock algorithm on top of StackExchange.Redis. It coordinates locks across multiple independent Redis instances so only one process uses a resource at a time, even across machines.

## Use cases
- acquire distributed locks across multiple redis instances in .net
- ensure only one process runs a scheduled job across machines
- prevent duplicate processing of a resource in a microservices cluster
- implement leader election or mutual exclusion with redis
- lock a resource using redlock algorithm in c#

## When to choose
- you need distributed locking in a .NET application with Redis available
- you want quorum-based locking across independent Redis masters for fault tolerance
- you want automatic lock renewal and expiry handling

## When to avoid
- you only run a single Redis instance and simple SET NX locking suffices
- your project does not use .NET or StackExchange.Redis
- you need strongly consistent locking guarantees that Redlock's timing assumptions cannot provide

## Facets
- artifact type: library
- maturity: stable
- function: caching, concurrency, database-driver
- domain: microservices, databases, developer-tools, backend
- platform: dotnet, c
- tags: redlock, redis, distributed-locks, stackexchange-redis, nuget

## Member repositories
- samcook/RedLock.net (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:23.035965+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-30T07:00:24.788479+00:00, confidence not recorded.
  - readme: https://github.com/samcook/RedLock.net (fetched 2026-08-28T04:03:23.035965+00:00, sha 4d54d0d8eb68)
- Data as of 2026-08-30T08:39:29.467469+00:00.
