Design Google Drive

Hard45 min
1 / 30
System design answer

Design Google Drive

Hard45 min30 sections
understanding•8 min read

Problem Statement: A Permissioned Namespace With Live Documents

Frames the system as three coupled products: a blob store, a shared permissioned namespace, and a real-time collaborative editor.

Problem statement

Design a cloud storage product where a user places files into a folder hierarchy, shares a file or an entire subtree with named people, groups, or anyone holding a link, edits documents concurrently with other people in the same browser tab, browses full revision history, and keeps working offline on a laptop that syncs when the network returns.

The naive framing is "Dropbox with Docs attached." That framing loses the interview. This is three systems with different correctness rules glued together by one identifier space:

  1. Blob plane — immutable, content-addressed bytes. Throughput and cost dominate. Eventual replication is fine; a byte that exists is never rewritten.
  2. Namespace plane — mutable metadata: names, parents, ownership, permissions, revisions, quota. This is a transactional distributed database with a hierarchy and an access-control lattice. Correctness dominates. A wrong allow here is a data breach, not a stale cache.
  3. Collaboration plane — an ordered operation log per open document with millisecond fan-out. Latency dominates. A single sequencer per document gives total order; clients transform or merge.

Why the coupling is the hard part

A permission change on a folder must retroactively change access to every descendant, including a document currently open in forty browsers, a thumbnail cached on a CDN, a search index shard, and a desktop client that has been offline for six days. A byte upload is easy. Propagating the right to see that byte through five derived systems, with a bounded revocation window, is the actual design problem.

Public anchors versus assumptions

Google's own blog announced Drive passing one billion users in 2018, and Google has publicly described Workspace as having more than three billion users across Gmail, Drive, Docs and Meet. Dropbox engineering has published Magic Pocket, its in-house exabyte-scale blob store, and the Nucleus sync-engine rewrite in Rust. Those are published facts about other companies. Every number in the capacity sections of this answer that is not attributed is an explicit design assumption for a fictional system, labelled as such.

The four invariants to state in the first two minutes

  • Bytes are immutable and content-addressed; only metadata mutates.
  • Every read of content is authorized against a current permission epoch, never against an index or a cache that merely remembers a past decision.
  • Every document has exactly one ordering authority at a time.
  • Every client converges from an opaque cursor, and a cursor that is too old degrades to a full resync rather than to silent divergence.

Key Highlights

  • •Three planes with three different correctness rules: immutable blobs, transactional permissioned metadata, ordered per-document op log.
  • •A folder permission change must reach descendants, live editor sessions, CDN caches, search shards, and offline clients within a bounded revocation window.
  • •Google publicly reported Drive crossing one billion users in 2018; all uncited numbers here are stated design assumptions.
  • •Authorization is checked against a permission epoch at content-read time, not against a search index or a cached ACL decision.
  • •An expired sync cursor triggers a full resync, never a partial merge that could silently drop a tombstone.
Open With the Plane Split
Say: 'Bytes are immutable and eventually replicated; the namespace and its ACLs are linearizable; each open document has one sequencer.' Three sentences separate you from every candidate who says 'I'd use S3 and a database'.
Do Not Design a File Server
A design that treats this as upload/download plus a folder table will collapse when the interviewer asks what happens to a document open in forty tabs when the parent folder is unshared.

Section Rescue Kit

Buzzwords to use:

Permission EpochContent-Addressed Storage

Safe statements:

  • "Let me separate the immutable byte plane from the mutable permissioned namespace before choosing any storage technology."
  • "The interesting failure here is not a lost upload; it is a revoked user who can still read a cached preview."
Design Google Drive - System Design | WinJob | WinJob