distributed-locks
Installation
SKILL.md
Distributed Locks
Coordinate exclusive access to resources across multiple service instances.
Overview
- Preventing duplicate processing of jobs/events
- Coordinating singleton processes (cron, leaders)
- Protecting critical sections across instances
- Implementing leader election
- Rate limiting at distributed level
Lock Types Comparison
| Lock Type | Durability | Latency | Use Case |
|---|---|---|---|
| Redis (single) | Low | ~1ms | Fast, non-critical |
| Redlock (multi) | High | ~5ms | Critical, HA required |
| PostgreSQL advisory | High | ~2ms | Already using PG, ACID |