Coordination Model
Clustron DKV provides a set of primitives that allow multiple application instances to coordinate safely using shared state.
These primitives are built on top of:
- Key-value storage
- TTL and lifecycle management
- Leases (ownership + expiration)
The Core Ideaβ
Coordination in Clustron is based on:
Shared state + controlled ownership + automatic recovery
This allows distributed applications to behave predictably, even under failure.
Available Primitivesβ
Clustron provides three core coordination primitives:
- Locks β control exclusive access
- Counters β maintain shared numeric state
- Watch β react to changes in real time
Locksβ
Locks ensure that only one client can access a resource at a time.
Example Use Casesβ
- Prevent duplicate job execution
- Ensure only one worker processes a task
- Protect critical sections
Key Propertiesβ
- Exclusive ownership
- Safe under failure (via leases)
- Automatically released if the owner fails
Countersβ
Counters allow multiple clients to safely update shared numeric values.
Example Use Casesβ
- Tracking active workers
- Rate limiting
- Distributed metrics
Key Propertiesβ
- Atomic updates
- Consistent across nodes
- No manual synchronization required
Watchβ
Watch allows clients to observe changes to keys or prefixes.
Example Use Casesβ
- Reacting to configuration changes
- Monitoring state transitions
- Triggering workflows
Key Propertiesβ
- Real-time notifications
- Works across distributed nodes
- Eliminates polling
How It Fits Togetherβ
All coordination primitives are built on the same foundation:
Keys β TTL β Leases β Coordination
- Keys store state
- TTL manages lifetime
- Leases manage ownership
- Coordination primitives build on top
Why This Mattersβ
Without a unified model, distributed systems often require:
- Separate systems for locking
- Separate systems for messaging
- Manual coordination logic
Clustron provides:
- A single system
- A consistent API
- Built-in safety and lifecycle management
Design Philosophyβ
Clustronβs coordination model focuses on:
- Simplicity
- Safety under failure
- Predictable behavior
You interact with coordination primitives the same way you interact with data.
Whatβs Nextβ
π Continue to the Developer Guide to see how to use locks, counters, and watch in code