Distributed Computing From First Principles
by Kenneth Emeka Odoh
180+ page textbook with complete, working implementations of distributed algorithms in C/OpenMPI. Not pseudocode—actual code for Paxos, Raft, CRDTs, and BFT.
A 180+ page textbook with complete, working implementations of distributed algorithms in C/OpenMPI. Not pseudocode—actual code you can compile and run. Covers Paxos, Raft, CRDTs, Byzantine Fault Tolerance, logical clocks, consensus protocols, and more. Written by a senior engineer who went from humble beginnings to mastering low-level distributed systems from scratch.
Core Thesis
Most distributed systems knowledge is locked in research labs and Big Tech. This book breaks that barrier by providing runnable implementations of every algorithm, not just descriptions. Rather than pontificate on state-of-the-art algorithms, it solidifies the fundamentals with code you can actually execute and modify.
Key Insights
1. Message-Passing as Foundation
Everything in distributed systems reduces to message passing. The book builds on OpenMPI (Message Passing Interface), teaching you to think in terms of processes, ranks, and communication patterns. Once you understand message-passing fundamentals, higher-level abstractions like gRPC, REST, or message queues become obvious extensions.
This matters for production work: when debugging etcd failures or Kafka replication issues, you need to understand what messages are flowing between nodes, not just what the API documentation says.
2. Network Protocol Trade-offs
TCP versus UDP versus QUIC is not just about "reliable versus fast." The book breaks down when each protocol makes sense:
- TCP: Guaranteed delivery, ordered packets, built-in congestion control. Use for databases, consensus protocols, anything where correctness beats speed.
- UDP: Minimal overhead, no delivery guarantees. Use for real-time streams where dropping packets is acceptable (video, gaming, DNS).
- QUIC: TCP-level reliability with UDP-level latency, multiplexing without head-of-line blocking. Use for HTTP/3, low-latency APIs, modern cloud services.
When you're architecting multi-region services, knowing these trade-offs lets you pick the right transport layer instead of defaulting to TCP everywhere.
3. Consensus Algorithms with Full Implementations
The book provides complete C/OpenMPI implementations of:
- Paxos with Snapshot Recovery: The original consensus algorithm. Complex but foundational. Understanding Paxos means you understand why consensus is hard.
- Raft (leader-based consensus): Simpler than Paxos, used in etcd, Consul, CockroachDB. The book shows how leader election works, log replication, and failure recovery.
- Two-Phase Commit: Atomic transactions across distributed nodes. Shows why 2PC fails under network partitions (the FLP impossibility theorem in action).
When your production Consul cluster loses quorum or etcd splits, knowing how Raft handles leader election failures is the difference between panic and methodical debugging.
4. Anti-Entropy Techniques for Fault Tolerance
Distributed systems fight entropy constantly. Nodes fail, networks partition, clocks drift. The book covers anti-entropy techniques:
- CRDTs (Conflict-free Replicated Data Types): Grow-only Counter, Last-Write-Wins Map. These let you replicate state across data centers without coordination. Used in Riak, Redis, DynamoDB.
- Gossip Protocols: Nodes share state with random neighbors. Eventually consistent, highly available. Used in Cassandra, Consul, membership protocols.
- Erasure Coding: Store data redundantly so you can lose nodes without losing data. Used in S3, GCS, distributed file systems.
For multi-region architectures, CRDTs are the key to conflict-free replication. Instead of fighting eventual consistency, you design data structures that converge naturally.
5. Formal Verification for Mission-Critical Systems
The book introduces TLA+ and formal methods to prove safety and liveness properties. Safety means "nothing bad happens" (no split-brain, no data corruption). Liveness means "something good eventually happens" (requests eventually complete).
When you're building payment systems, medical devices, or financial infrastructure, you cannot rely on testing alone. Formal verification guarantees correctness under all possible interleavings.
Memorable Quotes
"Rather than pontificate on state-of-the-art distributed algorithms, we adopt the approach of solidifying the fundamentals."
"Fault tolerance must be a fundamental architectural requirement, not an afterthought."
"The FLP impossibility theorem proves that consensus is impossible in asynchronous systems with even one faulty process. Yet we build systems that work anyway."
Practical Takeaways
-
Microservices: Use Raft for leader election in service discovery. Implement gossip protocols for health checks. Apply CRDTs for distributed caching across regions.
-
Multi-region: CRDTs solve conflict-free replication. Instead of last-write-wins with timestamps (broken under clock skew), use grow-only counters or causal trees.
-
Event streaming: Kafka uses Paxos-like protocols for cluster coordination. Understanding Paxos means you can debug split-brain scenarios and quorum loss.
-
Debugging: When etcd or Consul fails, trace the Raft log. Check leader election, term numbers, log indices. The book teaches you what those mean.
-
Chaos testing: The book's testing approach (injecting faults, network partitions, process crashes) should be in your CI/CD pipeline. Chaos engineering is not optional for distributed systems.
Who Should Read This
Backend engineers working with microservices, cloud architects designing multi-region systems, distributed systems practitioners who want to move beyond API docs to first principles. Anyone debugging Kafka, Consul, etcd, CockroachDB, or any distributed database.
If you've ever wondered "how does etcd actually elect a leader?" or "why does my multi-region write conflict resolution break under partition?", this book answers those questions with runnable code.
Rating: ⭐⭐⭐⭐⭐ (5/5)
This is the distributed systems textbook I wish I had 5 years ago. Most books give you pseudocode and theory. This one gives you working C/OpenMPI implementations you can compile, run, modify, and break. When you finish, you will understand consensus algorithms, fault tolerance, and distributed protocols at the implementation level, not just conceptually.
The only downside: it requires C proficiency and OpenMPI familiarity. But if you have those, this book is a master class in building distributed systems from scratch.
Get new posts in your inbox
Architecture, performance, security. No spam.
More Summaries
Headcount Zero: How to Build an AI-Run Company with Paperclip
Anthony David Adams
One founder, zero employees, AI agents as your workforce. A 5-person team costs $427K/year. The equivalent AI team? $6.6K/year. That's 98.5% cost reduction.
The Strategy Engine: Business Models, Unit Economics & Moats
Niraj Kumar
A world-class guide to business strategy for builders and investors. 33 chapters, 112 case studies, 15 quantitative models covering business models, competitive moats, and unit economics.
Fundamentals of Dark Matter
Ignacio Ferreras
From galaxy rotation curves to the cosmic microwave background—the complete case for dark matter. Explore WIMPs, axions, simulations, and why we're 95% sure the universe is mostly invisible.