Data-Intensive Systems
How databases, replication, partitioning, transactions, consensus, batch and stream processing really work — the foundations behind every system design decision about data.
Most backend systems are limited by data, not by CPU: how much of it there is, how fast it changes, and how many copies must agree. This section explains the machinery under the databases, caches, queues and stream processors that the rest of the handbook uses as building blocks. It follows the structure of Martin Kleppmann’s Designing Data-Intensive Applications, with each idea connected back to Java, Spring and system design practice.
Foundations: one machine
- Reliability, Scalability and Maintainability — what the goals mean and how to measure load and performance.
- Data Models and Query Languages — relational, document and graph models.
- Storage Engines: LSM-Trees, B-Trees and Column Stores — how databases store and find data.
- Encoding and Schema Evolution — JSON, Protocol Buffers, Avro, and compatibility.
Distributed data: many machines
- Replication — leaders, followers, lag, multi-leader and leaderless quorums.
- Partitioning (Sharding) — splitting data by key or hash, secondary indexes, rebalancing and routing.
- Transactions and Isolation Levels — ACID, anomalies, snapshot isolation and serializability.
- The Trouble with Distributed Systems — partial failures, unreliable networks and clocks, fencing.
- Consistency and Consensus — linearizability, ordering, two-phase commit, Raft and Paxos.
Derived data: systems of systems
- Batch Processing — MapReduce, dataflow engines and joins at scale.
- Stream Processing — logs, change data capture, event sourcing and windows.
The system design building blocks apply these ideas to caches, load balancers, queues and ID generators, and the case studies apply them end to end.
Articles
- Reliability, scalability, maintainabilityThe three goals of every data system, made measurable: faults versus failures, hardware, software and human errors; describing load with parameters such as fan-out; measuring performance with percentiles and tail latency; vertical versus horizontal scaling; and operability, simplicity and evolvability.
- Data modelsRelational, document and graph data models compared: the object-relational mismatch, one-to-many versus many-to-many relationships, schema-on-read versus schema-on-write, data locality, declarative versus imperative queries, and property graphs and triple stores — with guidance on choosing a model.
- Storage enginesHow databases store and find data: append-only logs and hash indexes, SSTables and LSM-trees with compaction and Bloom filters, B-trees with write-ahead logs, write and read amplification, secondary and covering indexes, in-memory databases, OLTP versus OLAP, data warehouses, star schemas and column-oriented storage.
- Encoding and evolutionHow data is encoded for storage and transmission, and how to change its schema without breaking running code: backward and forward compatibility, Java serialization pitfalls, JSON and its number and binary problems, Protocol Buffers and Avro, schema registries, and compatibility rules for databases, REST and RPC, and message brokers.
- ReplicationKeeping copies of data on several machines: single-leader replication with synchronous and asynchronous followers, failover and split brain, replication logs, the problems of replication lag (read-your-writes, monotonic reads, consistent prefix), multi-leader and leaderless replication with quorums, sloppy quorums and conflict resolution.
- Partitioning (sharding)Splitting a dataset across machines: horizontal versus vertical partitioning, partitioning by key range versus by hash, hot spots and skew, local versus global secondary indexes, rebalancing strategies (fixed partitions, dynamic splitting, consistent hashing), request routing, and the cost of cross-shard joins and transactions.
- Transactions and isolationWhat ACID really guarantees, and the concurrency anomalies each isolation level allows: dirty reads and writes, read skew, lost updates, write skew and phantoms. Read committed, snapshot isolation and MVCC, preventing lost updates, and the three ways to get serializability: serial execution, two-phase locking and serializable snapshot isolation.
- Distributed systems faultsWhy distributed systems are hard: partial failures, unreliable networks and timeouts, why you cannot distinguish a slow node from a dead one, time-of-day versus monotonic clocks, clock skew and last-write-wins, process pauses, the majority deciding truth, leases and fencing tokens, Byzantine faults and system models.
- Consistency and consensusThe strongest guarantees a distributed system can offer and what they cost: eventual consistency versus linearizability, the CAP trade-off made precise, causal ordering, Lamport timestamps, total order broadcast, two-phase commit and its blocking problem, consensus algorithms (Raft, Paxos, Zab), and coordination services like ZooKeeper and etcd for leader election and locks.
- Batch processingProcessing large, bounded datasets: the Unix philosophy as the model for batch jobs, distributed filesystems, MapReduce's map, shuffle and reduce phases, sort-merge, broadcast and partitioned hash joins, handling skew, why batch outputs should be immutable, and how Spark and Flink dataflow engines improve on MapReduce.
- Stream processingProcessing unbounded event streams: message brokers versus log-based brokers like Kafka, partitions and consumer offsets, keeping systems in sync with change data capture, event sourcing and immutable state, stream analytics, event time versus processing time, window types, stream joins, and exactly-once through idempotence and atomic commit.