Skip to main content

GFS and Chubby

BigTable does not implement its own storage layer or its own distributed coordination. Instead, it delegates these problems to two specialized systems: GFS for storage and Chubby for coordination. This layered design is a powerful architectural pattern -- each system solves one problem well.

Think first
BigTable needs durable, replicated storage and distributed coordination (master election, service discovery). Should it build these capabilities itself, or delegate them to specialized systems? What are the trade-offs?

GFS

GFS is Google's distributed file system, purpose-built for large data-intensive workloads.

PropertyDetail
File structureFiles broken into fixed-size Chunks
StorageChunks stored on ChunkServers
MetadataManaged by the GFS master
ReplicationEach chunk replicated across multiple ChunkServers on different racks
Data pathClients read/write directly to ChunkServers (metadata only from master)

In BigTable's context: SSTables are divided into blocks, and those blocks are stored as GFS chunks on ChunkServers. This means BigTable gets durable, replicated storage without managing replication itself.

For a detailed discussion, see GFS.

Chubby

Chubby is a highly available distributed lock service that keeps a multi-thousand-node BigTable cluster coordinated.

PropertyDetail
ReplicasTypically five active replicas; one elected master
ConsensusPaxos algorithm for replica consistency
InterfaceNamespace of files and directories, each usable as a lock
AtomicityRead/write to a Chubby file is atomic
SessionsClients maintain sessions with lease-based expiration
CallbacksClients register for change or session-expiry notifications
warning

BigTable's dependency on Chubby is total. If Chubby is unavailable for an extended period, BigTable becomes unavailable too. This is a deliberate trade-off: BigTable gets strong coordination guarantees but inherits Chubby's availability characteristics.

What BigTable uses Chubby for

Use caseMechanism
Master electionMaster acquires and periodically renews a session lease in Chubby
Bootstrap locationThe root of BigTable's metadata hierarchy is stored in a Chubby file
Tablet server discoveryNew Tablet servers register in Chubby's "servers" directory
Schema storageColumn family information for each table lives in Chubby
Access controlACLs stored as Chubby files
Interview angle

BigTable's reliance on Chubby illustrates the separation of concerns principle in distributed systems. Rather than embedding consensus into BigTable, Google built one lock service (Chubby) and reused it across BigTable, GFS, and MapReduce. When asked about coordination in a system design interview, propose a similar pattern: use a dedicated coordination service (ZooKeeper, etcd, Chubby) rather than baking consensus into every component.

Quiz
What would happen if Chubby experienced a prolonged outage (say, 30 minutes) while BigTable was serving production traffic?