</> MAANG.io

Expert

Design landmark systems in depth, from Dynamo, GFS, Bigtable and Kafka to payments and ads pipelines.

0 of 232 solved 0%

Section 6: A Master That Never Sees a Byte - High-Level Architecture

Executive Summary: The architecture has five kinds of box and one scheduler underneath. A client library in every application process caches tablet locations. One master assigns tablets, detects dead servers, balances load, merges small tablets, applies schema changes and garbage-collects SSTables, and stays off the data path. 1,000 tablet servers each serve ~1,000 tablets and split them as they grow. A 5-replica Chubby cell holds the master lock, the server membership directory, the root tablet's location, and schemas and ACLs. GFS stores every durable byte: the commit logs and the SSTables. Because a tablet server owns no unique durable state, moving a tablet moves a pointer, not data. Maya's read costs one cached lookup and one RPC; the crawler's write adds a commit-log append to three GFS replicas before the ack.

The interviewer taps Section 5's sketch of the com.cnn.www row. "Good map. Now show me the machines, and show me a byte moving."

You: "Five boxes, then two journeys: Maya's read just after her 08:14 search and the crawler's 09:00:00 write. Watch the master while I walk them. It won't appear on either path."

The Whole Cell on One Board

The whole Bigtable cell: the client library finds the root in Chubby and the tablet in METADATA only when cold, then reads and writes rows on the tablet servers, while the master assigns and polls tablets, everything holds locks in Chubby, and tablet servers keep commit logs and SSTables on GFS

Box Count Owns Never does
Client library One per app process Location cache, prefetch of neighbouring entries, retries Ask the master where a row lives
Master 1 (plus standby candidates) Tablet assignment, failure detection, balancing, merges, schema changes, SSTable GC Carry a read or write
Tablet servers 1,000 (25 racks × 40) ~1,000 tablets each: memtables, caches, one commit log, splits Hold the only copy of anything
Chubby cell 5 replicas Master lock, servers directory, root tablet location, schemas and ACLs Store user data or sit on the request path
GFS Same 1,000 machines Commit logs and SSTables, 3 replicas on 3 racks Know what a row or tablet is
Cluster scheduler Shared with other jobs Starting, restarting and placing processes Decide which tablet goes where

Notice where the location data lives. The METADATA table is itself a Bigtable table, served by ordinary tablet servers: a root tablet that never splits plus 8 METADATA tablets, about 1 GB in total. Chubby only stores the pointer to the root. Section 7 takes the three hops apart; here it's enough that a cold client pays 3 round trips once, then hits its cache.

Quick check before moving on:


Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.