distrib-txn-db
A workshop-style Java implementation that builds distributed transaction ideas in layers: clocks first, then versioned storage, routing, intents, uncertainty handling and finally a simplified serializable layer.
Build the invariants in dependency order.
The project is intentionally educational: each module introduces one failure mode or consistency mechanism before the next layer depends on it.
The project is strongest where it shows why isolation levels fail.
Snapshot isolation is useful, but write skew and clock uncertainty require additional mechanisms.
Hybrid Logical Clocks
Every request/response can carry a timestamp that combines wall-clock progress with a logical counter, giving distributed operations a monotonic ordering mechanism.
Foundation for MVCC visibility.Write intents
Provisional writes represent uncommitted transaction state while coordinator records define transaction outcome.
Invariant: readers must resolve intent status.Clock uncertainty + read restart
If a snapshot may have missed a value inside the uncertainty window, the transaction restarts at a later timestamp rather than trusting an ambiguous read.
Repair: safe snapshot before later conflict checks.Serializable conflict prevention
A simplified read-provisional mechanism prevents write skew that snapshot isolation alone can permit.
Goal: preserve cross-key invariants.