Coordinate concurrent operations safely across your cluster. Prevent race conditions and ensure only one critical operation runs at a time.
You're migrating a database schema across 10 application servers. Only ONE server should run the migration at a time. Quorum-based locking ensures this.
# Acquire lock (requires majority agreement)
$ curl -X POST /api/v1.0/lock \
-d '{
"scope": "db-migration",
"action": "lock"
}'
{
"status": "locked",
"scope": "db-migration",
"quorum": "6/10 nodes agreed",
"holder": "migration-orchestration-001"
}
# Release lock
$ curl -X POST /api/v1.0/lock \
-d '{
"scope": "db-migration",
"action": "unlock"
}'
Unlike Kubernetes' single etcd master, this is truly distributed.
Interactive shell for managing locks without writing code:
manager lock acquire --scope SCOPEmanager lock status --scope SCOPEmanager lock release --scope SCOPEDShell provides a clean interface for HTTP APIs. Perfect for ops teams who prefer CLI over REST.
# Start interactive dshell
$ dshell -s cluster-node-1 -p 20194 -u admin
# Acquire distributed lock
dshell> manager lock acquire --scope db-migration
Lock acquired. Holder: dshell-session-001
# Check lock status
dshell> manager lock status --scope db-migration
LOCKED by dshell-session-001 (5/7 nodes)
# Release lock
dshell> manager lock release --scope db-migration
Lock released
# Batch mode for scripts
$ dshell manager lock acquire --scope db-migration
{
"name": "safe-db-migration",
"steps": [
{
"name": "acquire-lock",
"action_type": "http",
"method": "POST",
"url": "https://node/api/v1.0/lock",
"body": {
"scope": "db-migration",
"action": "lock"
}
},
{
"name": "run-migration",
"action_type": "shell",
"code": "alembic upgrade head"
},
{
"name": "release-lock",
"action_type": "http",
"method": "POST",
"url": "https://node/api/v1.0/lock",
"body": {
"scope": "db-migration",
"action": "unlock"
}
}
]
}
Use locks to coordinate multi-step operations:
Support both exclusive locks and shared read locks. Allow multiple readers, but exclusive access for writers.
"lock_type": "read",
"scope": "config-db",
"holder": "reader-1"
// Multiple readers
"lock_type": "write"
// Only one writer
Automatically adjust lock timeout based on operation complexity and historical execution time.
"timeout": "auto",
"min_timeout": 5s,
"max_timeout": 300s,
"learning_window": "7d"
Monitor lock contention, waiter queue, and hold duration for performance optimization.
"contention": {
"waiters": 3,
"hold_duration": "2.3s",
"conflict_rate": "12%"
}
Assign priorities to lock requests. High-priority operations skip the queue in emergency situations.
"priority": "high",
"reason": "incident_recovery",
"queue_position": "1"
"normal" / "low" also available
Prevent race conditions without a central coordinator.
Quorum agreement ensures correctness even if nodes fail.
Locks auto-release if holder crashes.
Multiple independent locks for different resources.