Welcome back. In our previous lesson, we analyzed Chubby, Google's distributed lock service, and saw how it provides a fault-tolerant coordination layer by implementing Paxos. You saw how its design prioritizes reliability and developer ergonomics, making it a cornerstone of Google's infrastructure.
Today, we shift our focus from coordination to storage, examining one of Chubby's most significant clients. We will analyze the core architecture of the Google File System (GFS) by dissecting the original 2003 paper. This system was designed to manage the colossal amount of data generated by Google's services and laid the groundwork for open-source counterparts like the Hadoop Distributed File System (HDFS). For anyone aspiring to a Principal Engineer role at Google, understanding GFS is like studying the architectural DNA of the company's data infrastructure.
The "Why": GFS Design Assumptions
Before diving into the architecture, it's essential to understand the unique constraints and workload patterns that shaped GFS. A system's design is a direct response to the problems it aims to solve. The GFS designers made several key observations about their environment that were a radical departure from traditional file system assumptions.
The video below gives an excellent overview of this context.
The Google File System - Paper Explained
This video from Arpit Bhayani provides a clear breakdown of the GFS paper, starting with the foundational design assumptions.
Watch the initial segment that covers the workload patterns and design assumptions Google observed. Pay close attention to the points about component failure, file size, and the nature of mutations (appends vs. overwrites).
To get the official and more detailed perspective, let's turn to the paper itself.
This is the seminal SOSP '03 paper by Ghemawat, Gobioff, and Leung that introduced GFS. It is a foundational text in distributed systems.
Please read the Introduction and the Design Overview (Sections 1 and 2.1). Focus on the four main observations in the introduction, starting from the discussion of failures, and the detailed list of assumptions in section 2.1, from the first bullet point to the last.
These assumptions are critical and worth summarizing, as they dictate almost every major architectural decision in GFS:
- Component failure is the norm: The system is built from thousands of inexpensive commodity machines. Failures of disks, memory, network, and power are routine events, not exceptions. Fault tolerance must be automatic and integral to the design.
- Files are huge: Multi-gigabyte files are common. The system is optimized for storing a modest number of very large files, not billions of small ones.
- Writes are mostly appends: The dominant mutation is appending data to the end of a file. Random writes at arbitrary offsets are rare and need not be efficient. Once written, files are often read sequentially, many times.
- High bandwidth over low latency: For the target workloads (large-scale data processing), the total throughput of the system is more important than the response time of any single operation.
With this context in mind, let's examine the system's architecture.
The Core Components: Master, Chunkservers, and Clients
The GFS architecture is elegantly simple at a high level, consisting of three main types of entities.

- A Single Master: This server is the brain of the system. It stores all the file system metadata, which includes the file namespace (directory structure), access control information, the mapping from files to their constituent chunks, and the current locations of those chunks. Crucially, there is only one master at any time, a design choice that vastly simplifies the system.
- Multiple Chunkservers: These are the workhorses. They store the actual file data on their local disks. Files are broken up into large, fixed-size pieces called chunks, and chunkservers store these chunks as simple Linux files. For reliability, each chunk is replicated on multiple chunkservers (typically three).
- Multiple Clients: The GFS client is not a standalone process but a library linked into user applications (like MapReduce). It mediates all interaction with the file system, communicating with the master for metadata and directly with chunkservers for data.
Let's explore the rationale behind some of these key architectural elements.
Chunks: The Unit of Storage
Instead of storing a multi-gigabyte file as a single monolithic block, GFS divides it into fixed-size chunks of 64 MB. This size is much larger than typical file system blocks and provides several key advantages.
Google File System (GFS) - It's Ok To Fail | Distributed Systems Deep Dives With Ex-Google SWE
The "Jordan has no life" video provides a concise explanation of the file abstraction and the reasoning behind the large chunk size.
Watch the section that covers how files are abstracted into chunks and the benefits of the 64 MB chunk size.
The large chunk size is a direct consequence of the design assumptions:
- Reduces Master Interaction: A client only needs to contact the master once to get the location of a chunk. Since the chunk is large, a sequential read of a huge file can proceed for 64 MB before the client needs to talk to the master again.
- Reduces Network Overhead: A client is more likely to perform many operations on a given chunk, so it can maintain a persistent TCP connection to the chunkserver, reducing connection setup costs.
- Reduces Metadata Size: A larger chunk size means fewer chunks per file, which reduces the amount of metadata the master needs to store. This is what makes it feasible for the master to keep all metadata in memory.
The Single Master: A Controversial Simplification
Having a single master is perhaps the most defining feature of GFS's architecture. It simplifies the design immensely, as the master has global knowledge and can make sophisticated decisions about chunk placement and replication without needing a complex distributed protocol.
The key to preventing the master from becoming a bottleneck is the strict separation of control and data flow. Clients only contact the master for metadata. All data-bearing communication goes directly to and from the chunkservers.
Sections 2.3 and 2.4 of the paper detail the roles of the core components and justify the single master design.
First, read Section 2.3, "Architecture", for a formal description of the three main components. Next, read Section 2.4, "Single Master", to understand the rationale and how its involvement in I/O operations is minimized.
Master Metadata Management
The master's performance is critical. To ensure this, it stores all three major types of metadata in its main memory:
- The file and chunk namespaces.
- The mapping from files to chunks.
- The locations of each chunk's replicas.
Storing metadata in memory makes lookups extremely fast. But what about durability? If the master crashes, doesn't all the metadata disappear?
The Google File System - Paper Explained
The "Arpit Bhayani" video has a fantastic, detailed explanation of how the master manages its metadata, including the in-memory approach, the math behind its feasibility, and the role of the operation log.
Please watch the segment on master metadata storage. This covers why storing metadata in-memory is viable and how it is persisted.
GFS uses two mechanisms to protect its metadata:
-
Operation Log: For persistent metadata (namespaces and file-to-chunk mappings), the master maintains an operation log on its local disk, which is also replicated on remote machines. Any change is committed only after the log record is flushed. If the master restarts, it can recover its state by replaying this log. This is where a service like Chubby would be used in practice: the master replicas would use Chubby to elect a leader and to store the location of the active master, and the Paxos protocol would be used to reliably replicate the operation log.
-
Heartbeats: For non-persistent metadata (chunk locations), the master takes a simpler approach. It doesn't persist this information. Instead, it polls the chunkservers at startup and then stays up-to-date via periodic HeartBeat messages. Each chunkserver is the ultimate source of truth for which chunks it has on its own disks. This design elegantly sidesteps the complex problem of keeping state synchronized between the master and hundreds of chunkservers that can join, leave, or fail at any time.
Tracing a Simple Read
To bring these architectural concepts together, let's walk through the sequence of events for a simple read operation.

The process, also described in the paper and videos you've reviewed, unfolds as follows:
- The application code asks the GFS client library to read a certain byte range from a file.
- The client library translates the file name and byte offset into a chunk index (since chunks are a fixed size, this is simple arithmetic).
- The client sends a request to the master containing the file name and chunk index.
- The master looks up its in-memory metadata and replies with the unique chunk handle and the list of chunkserver locations that hold replicas of that chunk.
- The client caches this information. For subsequent reads to the same chunk, it will not need to contact the master again (until the cache entry expires).
- The client picks a chunkserver from the list (usually the one with the lowest network latency) and sends the request directly to it, specifying the chunk handle and the byte range to read.
- The chunkserver reads the data from its local disk and sends it back to the client.
This flow clearly demonstrates the decoupled control and data planes. The master acts as a directory service, while the chunkservers act as the data providers. This design allows the system's aggregate read bandwidth to scale with the number of chunkservers, unconstrained by the single master.
Conclusion
In this lesson, we have analyzed the core architecture of the Google File System. We saw how a set of specific design assumptions—commodity hardware, huge files, and append-heavy workloads—led to a unique and highly influential design.
The key architectural takeaways are:
- A Simplified Centralized Design: GFS uses a single master to manage all metadata, which simplifies the architecture and allows for globally optimal placement decisions.
- Separation of Concerns: The master is kept from becoming a bottleneck by separating the control plane (metadata operations) from the data plane (I/O), with clients communicating directly with chunkservers for data.
- Large Chunks: Files are divided into large, 64 MB chunks, which reduces metadata size, minimizes client-master interaction, and amortizes network overhead.
- In-Memory Metadata: The master keeps all metadata in memory for high performance, relying on a replicated operation log and checkpoints for durability.
- Replication for Fault Tolerance: Chunks are replicated across multiple chunkservers on different racks, making the system resilient to the frequent component failures expected in a large-scale commodity cluster.
We have now established the components of GFS and understand how they interact for read operations. However, writing data introduces new complexities, particularly around consistency when multiple clients are writing concurrently.
In our next lesson, we will build on this foundation to explain the GFS replication strategy and consistency model for concurrent operations. We will explore the clever use of leases to order mutations, a mechanism that provides consistency without the overhead of a full consensus protocol for every write.