← Back to public systems
Public system / 02

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.

Themes
Hybrid Logical Clocks
MVCC + intents
serializability
Structure
small isolated modules
anomalies before fixes
solutions branch
01 / Learning path

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.

module progressionpublic workshop
01 · HLCphysical + logical time
→
02 · MVCCversioned key/value reads
→
03 · Routingdistributed key placement
→
04–06 · Txnintents · restart · serializable layer
02 / Key ideas

The project is strongest where it shows why isolation levels fail.

Snapshot isolation is useful, but write skew and clock uncertainty require additional mechanisms.

01

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.
02

Write intents

Provisional writes represent uncommitted transaction state while coordinator records define transaction outcome.

Invariant: readers must resolve intent status.
03

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.
04

Serializable conflict prevention

A simplified read-provisional mechanism prevents write skew that snapshot isolation alone can permit.

Goal: preserve cross-key invariants.