# Designing Data-Intensive Applications on Cloudflare — DDIA Reference Suite

LightCavalry maintains an open-source reference implementation of Martin Kleppmann's *Designing Data-Intensive Applications* book, verified natively on Cloudflare Workers and Durable Objects.

- **GitHub Repository**: https://github.com/lightcavalry/ddia-on-cloudflare
- **Total Specs**: 973 automated tests
- **Verification Harness**: 100% Zero Mocks, full simulation under chaotic network partitions.

## Implemented Architectural Patterns

### 1. Reliable Storage & Retrieval (Chapters 3 & 4)
- Append-only log storage
- Segmented SSTables with Sparse Indexes
- Probabilistic Bloom Filters for key negative lookups
- B-Tree page layouts with Write-Ahead Logging

### 2. Distributed Replication (Chapter 5)
- Single-leader replication with semi-synchronous followers
- Multi-leader replication with Conflict Resolution (LWW & CRDTs)
- Leaderless replication (Dynamo-style) with Sloppy Quorums and Hinted Handoff

### 3. Partitioning & Sharding (Chapter 6)
- Consistent Hashing with virtual node distribution
- Range-based partitioning with automatic rebalancing
- Document-partitioned (local) vs Term-partitioned (global) secondary indexes

### 4. Transactions & Isolation (Chapter 7)
- Read Committed, Snapshot Isolation / MVCC
- Two-Phase Locking (2PL)
- Serializable Snapshot Isolation (SSI)

### 5. Distributed Consistency & Consensus (Chapters 8 & 9)
- Linearizability verification
- Vector Clocks & Causal Ordering
- Distributed Two-Phase Commit (2PC)
- Raft Consensus Protocol with dynamic cluster membership
