Course map

Topic 215 / Specialist

Distributed file systems

Chapter 13.7 · Distributed File Systems

What and why

Object storage (→ 79) gives applications a simple, flat API — put or get a blob by key — and hides how the underlying system stores and protects data. A distributed file system is one way that underlying system is built: large files are split and spread across many machines with enough redundancy to survive individual machine failure. Understanding chunking, replication, and metadata serving explains what object storage abstracts away, and surfaces a different durability option — erasure coding — than simply storing extra copies. Builds on: → 79 (object storage and file storage).

Diagram

Client ──"where are file X's chunks?"──► Metadata server
Client ◄──chunk list + node locations────┘
Client ──read/write chunk bytes directly──► Data nodes (chunk, chunk, chunk — each replicated)

How it works

  1. A large file is split into fixed-size chunks, each stored independently and replicated across multiple nodes.
  2. A metadata server tracks which chunks make up which file and which nodes hold which chunk — a directory layer kept deliberately small and separate from chunk storage, so it can keep serving quickly even as the total data in chunk storage grows.
  3. Clients ask the metadata server where a file's chunks live, then read and write chunk bytes directly against the data nodes — metadata servers never sit on the path for the actual bytes, which is why they don't become a throughput bottleneck as file count grows.
  4. Replication (several copies, illustratively) gives durability and availability: a chunk stays available as long as at least one of its replicas survives.
  5. Object storage (→ 79) differs in access model — whole-object put/get, not file semantics with byte ranges or appends — and typically hides chunking, replication, and metadata serving entirely behind an HTTP API; it is frequently built on a system much like this one, just not exposed as a filesystem.
  6. Erasure coding trades replication's simple copies for computed redundancy: split data into k fragments plus m parity fragments such that any k of the k+m fragments reconstruct the original. This gives comparable durability to replication at meaningfully less raw storage, at the cost of CPU to encode and decode, and slower reconstruction after a failure — replication just copies a surviving replica; erasure coding computes the missing fragment from the others.

Practical example

(illustrative). A 300 MB file split into 3 chunks of 100 MB each, replicated 3× for durability, uses 3 × 300 MB = 900 MB of raw storage for 300 MB of data — a 3× overhead. An erasure-coded scheme using 6 data fragments and 3 parity fragments of 50 MB each (6 × 50 MB = 300 MB of original data, 9 × 50 MB = 450 MB raw total) tolerating a similar number of lost fragments needs only 450 MB raw — a 1.5× overhead — at the cost of needing to read and compute across multiple fragments to reconstruct a lost one, instead of simply copying a surviving replica.

When to use it

  • Use when: building or operating the storage layer underneath large-scale file or big-data processing systems, or choosing between replication and erasure coding for a storage system's durability economics.
  • Avoid when: the application only needs a put/get blob API — object storage (→ 79) already provides this without requiring anyone to operate the chunked filesystem underneath it.
  • Failure scenarios: a metadata server becoming a bottleneck or single point of failure if it isn't itself replicated; a chunk's replicas all landing in the same failure domain, collapsing the intended redundancy without anyone noticing until a correlated failure hits; erasure coding's reconstruction cost spiking read latency during a node failure, exactly when the system is already degraded.
  • Simpler alternative: managed object storage (→ 79) for nearly all application-level needs; build or operate a distributed file system only when you are the team building that storage layer itself.

Practice

(Process kind — design exercise; 20–30 min, no lab services). On paper, design chunking and replication for a 1 GB file using fixed 128 MB chunks and 3× replication: list the chunks, assign each to 3 of 5 hypothetical nodes such that no single node failure loses more than one replica of any chunk, and compute total raw storage used. Then redo the storage calculation assuming a 4+2 erasure-coded scheme instead of 3× replication, and compare the two totals. Done when your erasure-coded total is lower and you can state what it cost you to get there.

Key takeaway

A distributed file system is chunking, replication, and a separate metadata layer working together; erasure coding is a computed alternative to replication that lowers storage overhead at the cost of reconstruction time. Done when you can: compute and compare storage overhead for a replicated versus an erasure-coded scheme. Used next in: nowhere else in this book — a specialization for teams building storage infrastructure itself.

References

None — this topic makes no external claims.

Source directory

Search the guide