PAPER EXPLAINED
The Google File System
IntermediateAbout 45 min to read the paper
TL;DR
GFS is a distributed file system built for huge, mostly appended files on failure-prone commodity machines. It uses a single metadata master, large replicated chunks, leases for write ordering, and a relaxed consistency model that applications work around.
What problem does Google File System solve?
Google needed to store and process multi-terabyte data sets on hundreds or thousands of inexpensive machines, where some disks, machines or network parts are always broken. Its workloads also differed from traditional assumptions: files were multi-GB, writes were mostly appends, and many producers often appended to the same file at once. The system had to deliver high aggregate throughput, recover automatically from routine failures, and support concurrent appends without expensive locking. It also had to stay simple enough to build and operate.
The core idea
Each part of the system does one job. A single master holds all metadata in memory and makes global decisions such as where to place replicas. Clients get only chunk locations from the master and move data directly to and from chunkservers. Files are split into large 64 MB chunks, each stored on several machines. For writes, the master lends authority to one replica (the primary) through a lease, and the primary sets the order of changes. Instead of strict consistency, GFS offers an at-least-once atomic append and well-defined but relaxed guarantees. Applications handle the leftovers with checksums, unique IDs and checkpoints.
IN THE AUTHORS’ WORDS
“First, component failures are the norm rather than the exception.”
The Google File System, p. 1
“High sustained bandwidth is more important than low latency.”
The Google File System, p. 2
“Clients never read and write file data through the master.”
The Google File System, p. 3
How Google File System works
- A cluster has one master and many chunkservers running as ordinary Linux processes. Files are split into fixed 64 MB chunks, each with a unique 64-bit handle and stored by default as three replicas. The master holds all metadata and exchanges HeartBeat messages with the chunkservers.
- To read, the client converts a byte offset into a chunk index and asks the master for that chunk's handle and replica locations. It caches the answer and then reads directly from a nearby chunkserver, so file data never passes through the master.
- Metadata lives in the master's memory. Namespace and file-to-chunk changes are written to an operation log, replicated remotely and periodically checkpointed. Chunk locations are not stored but are collected by polling chunkservers.
- For writes, the master grants a 60-second, renewable lease to a primary replica. The client pushes data along a pipelined chain of nearby chunkservers, then sends the write request to the primary. The primary assigns serial numbers that all secondaries follow.
- Record append lets many clients add data to the same file concurrently. The primary picks the offset. If the record would overflow the chunk, the chunk is padded and the client retries on the next one. Failed attempts are retried, so the record lands at least once and may be duplicated.
- The master places replicas across racks, re-replicates chunks that fall below their goal (prioritizing those most at risk), rebalances load, and reclaims deleted files lazily. Version numbers identify stale replicas.
- For fault tolerance, servers restart in seconds, the master's log is replicated, and read-only shadow masters exist. Chunkservers checksum every 64 KB block so they never pass corrupted data to other machines.
Results
On a 16-chunkserver test cluster, 16 clients read at 94 MB/s in aggregate, about 75% of the 125 MB/s network limit. Writes reached 35 MB/s, about half of the 67 MB/s limit, and the authors blame their network stack for the slow writes. Record append to a single file dropped from 6.0 MB/s with one client to 4.8 MB/s with 16. In two production clusters, the master held only 48–60 MB of metadata and handled roughly 200–500 operations per second without becoming a bottleneck. After one chunkserver holding about 600 GB was killed, its chunks were restored in 23.2 minutes. Overwrites made up a tiny share of mutations. The authors caution that the test cluster was small and that the workloads were co-tuned with GFS.
Limitations and what came later
- All metadata sits on one master and in its memory. The authors argue this is not a serious limit in practice, but system capacity is bounded by master memory, and an earlier version did hit master bottlenecks on large directories.
- Individual client write throughput was about half the theoretical limit, which the authors attribute to their network stack.
- The relaxed consistency model and at-least-once record append push work onto applications, which must handle padding, fragments and duplicates.
- The design and measurements reflect Google's own co-tuned applications, and the authors warn against generalizing from their workload.
- Small files can become hot spots, lazy deletion can delay reuse of storage, and record append supports many-producer, single-consumer queues efficiently but not many-to-many queues.
Why Google File System matters
The paper shows how to build dependable, high-throughput storage from unreliable commodity parts by treating failure as routine and by matching the design to the real workload. Several of its ideas are reusable elsewhere: separating control from data flow, delegating write ordering through leases, collecting garbage lazily, and accepting relaxed consistency that applications can handle. The authors suggest many of their choices may apply to other large-scale, cost-conscious data processing.
This paper is a clear example of designing a storage system from observed workloads rather than from textbook defaults. The authors start from four observations about their environment: cheap machines fail constantly, files are very large, data is mostly appended and then read sequentially, and the applications can be changed along with the file system. Each major design choice follows from one of these. Those choices include a single metadata master, 64 MB chunks, three-way replication, leases that hand write ordering to a primary replica, an at-least-once atomic append, and a deliberately relaxed consistency model. The paper explains what each choice costs as well as what it gains. It also reports measurements from a test cluster and from production clusters, and it describes operational problems such as silent disk corruption and Linux kernel issues. Read it to learn how to reason about tradeoffs between simplicity, consistency and throughput in distributed systems. It is also a useful reminder that a design tuned to one workload may not transfer to another.
Before you read
Who it’s for
Students and engineers learning distributed systems or storage, and anyone who wants a worked case study of turning workload assumptions into concrete system design decisions.
What to know first
- Basic file system concepts: files, directories, blocks, caching
- Networking basics such as TCP, bandwidth and latency
- What replication is and why distributed machines fail
- Familiarity with locks and concurrent writers
Glossary
- Master
- The single server that holds all file system metadata in memory, manages leases and replica placement, and coordinates background tasks. It does not carry file data.
- Chunkserver
- A machine that stores chunk replicas as ordinary Linux files and serves reads and writes for given chunk handles and byte ranges.
- Chunk
- A fixed 64 MB piece of a file, identified by a globally unique 64-bit chunk handle and replicated on several chunkservers.
- Lease / primary
- A time-limited grant from the master that makes one replica the primary for a chunk. The primary decides the order in which mutations are applied to all replicas.
- Record append
- An operation that adds data atomically at least once at an offset chosen by GFS, letting many clients append to one file without extra locking.
- Consistent vs. defined region
- A consistent region looks the same to all clients whichever replica they read. A defined region is consistent and also shows exactly what one mutation wrote.
- Operation log
- The persistent, replicated record of metadata changes. It also defines the order of operations, and the master replays it, starting from the latest checkpoint, to recover.
- Chunk version number
- A counter the master increments with each new lease. It is used to detect replicas that missed updates while their chunkserver was down.
- Shadow master
- A read-only follower of the master that replays the operation log, possibly slightly behind, to serve reads when the primary master is down.
What to pay attention to
- How each design choice traces back to the workload assumptions listed in Section 2.1.
- Why the master is kept out of the data path, and how the large chunk size and client-side caching of chunk locations make that possible.
- Table 1 on page 4: the difference between a 'consistent' and a 'defined' file region, and which operations produce each.
- Record append writes data at least once, so applications must tolerate padding and duplicates using checksums and unique IDs.
- Control flow (client, then primary, then secondaries) is separated from data flow (pipelined along a chain of nearby machines).
- Chunk version numbers are how stale replicas are detected after a chunkserver misses updates.
- The authors' own warning on page 12 not to generalize from their workload.
Questions to keep in mind
- Why can a single master work without becoming a bottleneck, and what would eventually break this design?
- What does an application have to do to cope with GFS's relaxed consistency, and is that burden reasonable?
- Why does GFS skip client data caching when most file systems rely on it?
- How does lazy garbage collection simplify cleanup in a system where messages and machines routinely fail?
- Which design choices would you change for a workload of many small files with random overwrites?
Google File System quiz: check your understanding
1. What three kinds of metadata does the GFS master keep, and which of them is not stored persistently?
Show the answer
The master keeps the file and chunk namespaces, the mapping from files to chunks, and the locations of each chunk's replicas. The first two are made persistent through the operation log. Chunk locations are not persisted: the master asks chunkservers which chunks they hold at startup and whenever a chunkserver joins.
2. Name the advantages of the 64 MB chunk size that the paper gives, and one disadvantage.
Show the answer
Advantages: clients need to talk to the master less often; a client can keep a persistent TCP connection to a chunkserver, which reduces network overhead; and the master's metadata stays small enough to fit in memory. Disadvantage: a small file may occupy a single chunk, so the chunkservers holding it can become hot spots. This happened when an executable stored in GFS was launched on hundreds of machines at once.
3. How does GFS make sure all replicas apply mutations in the same order?
Show the answer
The master grants a lease on the chunk to one replica, called the primary. The primary assigns serial numbers to the mutations it receives, and every replica applies them in that order. Across leases, the order is determined by the sequence in which the master granted them.
4. What does record append guarantee, and what does it not guarantee?
Show the answer
It guarantees that the record is written atomically, as one contiguous sequence of bytes, at least once, at an offset GFS chooses and returns to the client. It does not guarantee that replicas are byte-for-byte identical. Retries can leave duplicates or padding, and the regions between successfully appended records may be inconsistent.
5. How does GFS detect stale replicas?
Show the answer
Every time the master grants a new lease, it increments the chunk's version number and records it on the up-to-date replicas. A chunkserver that was down misses this increment. When it restarts and reports its chunks and their versions, the master sees the old number and treats that replica as stale.
6. Why does each chunkserver verify its own data with checksums instead of comparing replicas?
Show the answer
Comparing replicas across chunkservers would be impractical. Replicas can also legitimately differ, because record append does not promise identical copies. So each chunkserver keeps a 32-bit checksum for every 64 KB block and checks the relevant blocks before returning data.
7. In the recovery experiment, how long did it take to restore the chunks after one chunkserver holding about 600 GB was killed?
Show the answer
All chunks were restored in 23.2 minutes, an effective replication rate of 440 MB/s. Cloning was limited to 91 concurrent clone operations, each capped at 6.25 MB/s.
Go a little deeper
GFS makes applications responsible for handling duplicates, padding and inconsistent regions in exchange for a simpler, faster file system. When is moving that complexity into applications a good trade? What does it depend on that held at Google, where the same organization controlled both GFS and its applications?
Read next
More papers on Distributed storage.
Related reading lists
Cite Google File System
Ghemawat, S., Gobioff, H., & Leung, S. (2003). The Google File System. ACM SOSP. https://doi.org/10.1145/945445.945450
@inproceedings{ghemawat2003google,
title = {{The Google File System}},
author = {Sanjay Ghemawat and Howard Gobioff and Shun-Tak Leung},
year = {2003},
booktitle = {ACM SOSP},
doi = {10.1145/945445.945450},
url = {https://static.googleusercontent.com/media/research.google.com/en//archive/gfs-sosp2003.pdf}
}Study Google File System in ReadingTrack
Add the paper to your ReadingTrack library with its authors, venue and year, and get this page’s quiz as suggested review cards. You choose which cards to keep; nothing enters your reviews until you accept it.