Wrapped up distributed systems (eecs491) in college and loved it. There, I built a replicated, sharded key-value store with Paxos, and now am diving deeper into dist-sys patterns through Fly.io's challenges.
What's Here
a series of dist-sys challenges, each one building on the last:
flowchart LR
echo["echo"]
uid["unique ids"]
broadcast["broadcast"]
counter["CRDT counter"]
log["Kafka-style log"]
txn["transactions"]
echo --> uid --> broadcast --> counter --> log --> txn
classDef blue fill:#dbeafe,stroke:#3b82f6,color:#1e293b
classDef green fill:#dcfce7,stroke:#22c55e,color:#1e293b
classDef amber fill:#fef3c7,stroke:#d97706,color:#1e293b
classDef slate fill:#f1f5f9,stroke:#64748b,color:#1e293b
class echo,uid,broadcast blue
class counter green
class log amber
class txn slate
The series starts with message plumbing and ends with the annoying parts: replication, ordering, caching, and consistency.
- Echo - Getting our feet wet with the framework
- Unique ID Generation - Making IDs that are actually unique across nodes
- Broadcast - Making nodes talk to each other reliably
- (3a) Single-Node Broadcast
- (3b) Multi-Node Broadcast
- (3c) Fault-Tolerant Broadcast
- (3d) Efficient Broadcast
- Part I
- Part II
- Grow-Only Counter - Building a CRDT (fancy distributed counter)
- Kafka-Style Log - Implementing a distributed log with some Kafka-like properties
- (5a) Single-Node Kafka-Style Log
- (5b) Multi-Node Kafka-Style Log
- (5c) Efficient Multi-Node Kafka-Style Log
- Transaction System - Building increasingly consistent distributed transactions
- (6a) Single-Node Transactions
- (6b) Read Uncommitted Transactions
- (6c) Read Committed Transactions
Each challenge has its own write-up explaining the key ideas and tradeoffs.
Final Thoughts
Finished all challenges! Started with simple echo servers, worked through message passing patterns, built CRDTs, replicated logs, and wrapped up with increasingly sophisticated distributed transaction systems - all while handling partitions and maintaining high availability. Still no silver bullets in distributed systems, but now I have a solid arsenal of patterns.
Setup
You'll need:
- Download from Maelstrom's releases page
- Go 1.20+
- Maelstrom 0.2.3 (the testing framework)
- Needs Java (OpenJDK)
Execute ./run.sh in a challenge directory to run the tests.