Home/Labs/Magic Pocket Erasure Ledger
All 280 Labs
INTERACTIVE LAB📦

Magic Pocket Erasure Coding Lab (Interactive)

Migrate exabytes off S3: Reed-Solomon shards versus 3x replication, chunk by chunk. Price Dropbox's custom storage: dedup content-addressed 4 MB chunks, encode them as 9+3 or 12+4 Reed-Solomon shards, kill racks, and measure the bandwidth delta sync saves on one edited file.

Magic Pocket Durability & Delta Sync Ledger

Trade 3x replication against Reed-Solomon erasure coding on exabytes of 4 MB chunks, then measure what delta sync saves a single edited file.

Unique chunks after dedup2.55 EB stored once
Raw disk under selected scheme3.40 EB (33% overhead)
Hardware saved vs 3x replication4.25 EB (56% fewer spindles)
Data survives 2 rack failuresYES (9 data + 3 parity shards)
Chunks in edited file256 × 4 MB
Upload: naive vs delta sync1024 MB vs 4 MB
Bandwidth saved by local SQLite hash diff99.6%
Reed-Solomon 9+3: any 3 of the 12 shards suffice, so 2 failed racks reconstruct in real time while 33% parity overhead replaces 200% for the same 11-nines durability.

How It Works Under the Hood

Serving five hundred petabytes from S3 was economically absurd for Dropbox, so Magic Pocket moved the exabyte scale onto custom hardware with erasure coding instead of replication. Each deduplicated chunk is split into k data shards plus m parity shards — 9+3 tolerates any three rack failures at 33% overhead versus 200% for 3x replication. Durability comes from reconstruct-on-loss across racks, and sync speed comes from the delta protocol: the client's local SQLite hash index tells the server which 4 MB blocks actually changed, so a edited one-gigabyte file re-uploads kilobytes, not gigabytes.

Core Architectural Principles

  • Erasure coding overhead: k+m shards store data at m/k extra bytes while surviving any m simultaneous shard losses.
  • Content-addressed dedup: SHA-256 chunk hashes mean identical blocks across users are stored exactly once, before coding.
  • Delta sync: a client-side hash manifest reduces a full-file re-upload to only the 4 MB chunks whose digests changed.
Interview Round Script

For object-storage design, quantify the coding decision: "3x replication costs 300% for two-failure tolerance; RS 9+3 costs 133% for three." Mention reconstruction bandwidth as the hidden cost — losing a shard rereads k shards to rebuild it. Then cover sync semantics: block-level dedup plus delta hashing is what makes Dropbox feel instant on huge files.

Key Trade-Offs

Erasure coding slashes storage cost but pays reconstruction bandwidth and latency; custom hardware beat S3 at scale only because Dropbox volume justified building it.

Related Curriculum Chapter

Dropbox: Block Storage Sync & Magic Pocket Architecture

Read Full Chapter Blueprint

Explore More Interactive Labs

View All 280 Labs