Files are sharded into fixed 1 KB chunks, replicated across storage servers, and indexed by a single metadata authority — so the cluster keeps serving reads and writes even when a node disappears.
01 — Architecture
Borrowing the core idea of Google's GFS: keep the metadata layer independent from the storage layer, and let clients talk to each directly.
The single metadata authority. It tracks every file → chunk → replica location, hands clients a placement plan on write and locations on read, and orchestrates deletes and self-healing. It never stores or proxies chunk content.
The chunkservers. Each holds only the subset of 1 KB chunks assigned to it, one file per chunk on the local file system. They heartbeat the master and serve chunk bytes straight to clients.
Hides distribution entirely. It splits files into chunks, asks the master where things go, and reads/writes chunk bytes directly to the storage servers in parallel — the master is never in the data path.
Files are split into fixed-size 1 KB chunks. Each chunk gets a globally unique id and is placed round-robin across the live servers for balance.
Every chunk lives on 3 of the 4 storage servers. The spare lets the cluster re-replicate onto a healthy node after a single failure.
A background loop on the master spots under-replicated chunks after a node dies and copies them from a live replica to a spare — restoring the target factor.
02 — Live simulation
Trigger real operations and faults. Tokens travelling the wires are RPCs; the log mirrors what the actual services do.
03 — Communication protocol
Metadata goes through the master; bulk data goes straight to the storage servers. Every call is a gRPC RPC defined in gfs.proto.
04 — Fault tolerance
A core design goal: reason explicitly about every failure mode. Try Kill a node then Self-heal in the simulation above to see it live.
Recoverable. Reads keep working from the other replicas; the master routes clients to live copies. Writes continue as long as ≥3 servers are live. The healer re-replicates affected chunks onto the spare to restore the ×3 factor.
Single point of failure for availability. No new metadata operations can run. But chunk data stays safe on disk and metadata is durable in SQLite — once the master restarts and storage servers re-register, the cluster recovers fully.
With ×3 replication across 4 servers, the cluster survives any single simultaneous storage loss with full automatic recovery. Some reads survive even two losses — as long as every chunk keeps at least one live replica.
Unrecoverable only if all three replicas of a chunk fail before healing completes. Interrupted writes leave harmless pending metadata and orphan chunks, both garbage-collected automatically.
05 — Technology stack
A small, boring, dependable toolchain — fully containerised.