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.

Start the course

1. Distributed Systems Fundamentals

Why distribution is hard, time and ordering, consistency models, CAP/PACELC and replication.

  1. Why Distributed Systems Are Hard — Partial failure, unreliable networks and the fallacies of distributed computing.
  2. Time, Clocks and Ordering — Wall clocks, monotonic clocks, logical clocks and hybrid logical clocks.
  3. Consistency Models — Linearizability, sequential, causal, read-your-writes and eventual consistency.
  4. CAP and PACELC — What the theorems really say and how to use them.
  5. Replication Strategies — Single-leader, multi-leader and leaderless replication.

2. Data Distribution and Agreement

Partitioning, consensus, quorums, distributed transactions and CRDTs.

  1. Partitioning and Sharding — Split data across nodes by key range or hash.
  2. Consensus: Raft and Paxos Intuition — How nodes agree on a value or a log despite failures.
  3. Quorums and Tunable Consistency — R + W > N and what it does (and doesn't) guarantee.
  4. Distributed Transactions: 2PC vs Sagas — Atomicity across services and databases.
  5. Conflict Resolution and CRDTs — Merge concurrent updates in multi-leader and offline systems.

3. Coordination

Distributed locks, leader election, unique IDs and membership.

  1. Distributed Locks and Fencing Tokens — Mutual exclusion that survives pauses and partitions.
  2. Leader Election — Pick one active instance for singleton work.
  3. Unique IDs at Scale — UUIDv4, UUIDv7, ULID, Snowflake and database sequences.
  4. Service Discovery, Membership and Health — Find healthy instances in a changing fleet.

4. Distributed Systems in Practice

CDC, testing, tracing and real-world architectures.

  1. Change Data Capture — Stream database changes to other systems reliably.
  2. Testing Distributed Systems — Fault injection, Jepsen-style tests and deterministic simulation.
  3. Observing Distributed Systems — Tracing, correlation and debugging across services and queues.
  4. 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.

  1. Capstone: Multi-Region Inventory — Design inventory for a retailer selling in three regions.
  2. Capstone: Diagnose a Consistency Bug — Find the cause of duplicate processing and lost updates.