Free course · 20 lessons · Advanced
Distributed Systems for Backend Engineers
The theory behind modern backends: clocks and ordering, consistency models, CAP/PACELC, replication, partitioning, consensus, quorums, distributed transactions, CRDTs, locks with fencing, leader election, IDs, CDC and testing.
1. Distributed Systems Fundamentals
Why distribution is hard, time and ordering, consistency models, CAP/PACELC and replication.
- Why Distributed Systems Are Hard — Partial failure, unreliable networks and the fallacies of distributed computing.
- Time, Clocks and Ordering — Wall clocks, monotonic clocks, logical clocks and hybrid logical clocks.
- Consistency Models — Linearizability, sequential, causal, read-your-writes and eventual consistency.
- CAP and PACELC — What the theorems really say and how to use them.
- Replication Strategies — Single-leader, multi-leader and leaderless replication.
2. Data Distribution and Agreement
Partitioning, consensus, quorums, distributed transactions and CRDTs.
- Partitioning and Sharding — Split data across nodes by key range or hash.
- Consensus: Raft and Paxos Intuition — How nodes agree on a value or a log despite failures.
- Quorums and Tunable Consistency — R + W > N and what it does (and doesn't) guarantee.
- Distributed Transactions: 2PC vs Sagas — Atomicity across services and databases.
- Conflict Resolution and CRDTs — Merge concurrent updates in multi-leader and offline systems.
3. Coordination
Distributed locks, leader election, unique IDs and membership.
- Distributed Locks and Fencing Tokens — Mutual exclusion that survives pauses and partitions.
- Leader Election — Pick one active instance for singleton work.
- Unique IDs at Scale — UUIDv4, UUIDv7, ULID, Snowflake and database sequences.
- Service Discovery, Membership and Health — Find healthy instances in a changing fleet.
4. Distributed Systems in Practice
CDC, testing, tracing and real-world architectures.
- Change Data Capture — Stream database changes to other systems reliably.
- Testing Distributed Systems — Fault injection, Jepsen-style tests and deterministic simulation.
- Observing Distributed Systems — Tracing, correlation and debugging across services and queues.
- Real-World Architectures: DynamoDB, Spanner and Kafka — How production systems apply these ideas.
5. Capstone
Design a multi-region system and diagnose a consistency bug.
- Capstone: Multi-Region Inventory — Design inventory for a retailer selling in three regions.
- Capstone: Diagnose a Consistency Bug — Find the cause of duplicate processing and lost updates.