Until 2015, the contents of every file in Dropbox lived on Amazon S3. By 7 October 2015, 90% of that data was being served from Magic Pocket, a storage system Dropbox designed, built and filled itself, with no major service disruption and no data loss according to the company. In March 2016 it put the total at 500 petabytes of user data.
Its authors chose plain building blocks on purpose: immutable blocks, a sharded MySQL index, one coordinator per cluster. Most of the cleverness went into checking, constantly, that the data is still there.
Why Dropbox left a public cloud for file data
Dropbox stores two kinds of data: metadata about files and users, and the file contents. It has always run a hybrid setup. Metadata and web servers sat in data centres it managed, and file contents sat on S3. Dropbox's 2016 announcement says the company could not have grown as fast without it.
Growth is what changed the sums. The announcement's author says Dropbox held about 40 petabytes of user data when he joined in 2012, and that this grew more than twelve times in the following four years, to 500 petabytes and 500 million signups by March 2016. Dropbox gave two reasons for building its own system:
- Performance. Owning the whole stack let it tune storage end to end for its own workload.
- Unit economics. Its block storage workload is unusual, and at that scale custom hardware and software could store each byte more cheaply.
It also said it had to build from scratch, because nothing in open source was proven at that size. The stated design targets in 2016 were annual durability above 99.9999999999% and availability above 99.99%.
The move was not total. The same announcement says Dropbox would keep working with Amazon where it made sense, including storing data in Germany on AWS for European business customers.
The data model: blocks, buckets and volumes
Magic Pocket stores file content only, and it stores it in a deliberately restricted form. All sizes below are from Dropbox's May 2016 design post.
Blocks. A file is split into chunks of up to 4 MB. Each block is compressed and encrypted before it reaches Magic Pocket, and for most uses its name is the SHA-256 hash of its contents. A block is written once and never changes. When a user edits a file, the change is recorded in a separate metadata system called FileJournal, which points at new blocks. Mutability lives above the storage layer, not in it.
Buckets. Four megabytes is too small a unit to manage when a disk dies or data needs re-encoding. So blocks are gathered into 1 GB logical containers called buckets. Blocks in a bucket have nothing in common except that they arrived at about the same time.
Volumes. A volume is one or more buckets stored across a set of physical machines, either as full replicas or in erasure coded form. A volume is either open or closed. An open volume accepts new blocks and nothing else. A closed volume is immutable and can be moved around safely. Only a small number of volumes are open at any moment.
Live writes only ever touch open volumes, and background jobs such as repair and re-encoding only ever touch closed ones, so the two never race each other. Dropbox says this let it use far simpler consistency protocols.
Zones, cells and the path of a write
In 2016 Magic Pocket ran in three zones, in the western, central and eastern United States. Each block is stored in at least two zones, and replicated again inside each zone.
Inside a zone, the main parts are:
- Frontends. Gateways that accept requests and decide where a block goes.
- The Block Index. A map from block hash to cell, bucket and checksum. Dropbox considered building a dedicated key-value store and instead used a large sharded MySQL cluster behind an RPC layer, since it already ran thousands of MySQL nodes.
- Cells. Self-contained storage clusters of about 50 PB of raw capacity each in 2016. To add space, Dropbox adds a cell.
- OSDs (object storage devices). Storage machines full of disks, more than a petabyte per machine in 2016. They store blocks and know nothing about the cell's layout.
- The Replication Table. A small MySQL database per cell that maps each bucket to its volume and each volume to its OSDs, with an open flag and a generation number.
- The Master. One per cell. It watches OSD health, creates buckets and triggers repairs. It holds no authoritative state and no user traffic flows through it, so a cell keeps serving reads while its Master is down.

A write goes like this. The Frontend checks the Block Index to see whether the block already exists. If not, it picks an open volume, asks the Replication Table which OSDs hold it, and sends the block to all of them. Each OSD flushes the block to stable storage with fsync before replying. Once they have all succeeded, the Frontend adds the entry to the Block Index and answers the client. If an OSD fails along the way, the Frontend simply retries on a different volume, possibly in another cell. A separate daemon then copies the block to a second zone asynchronously, within about one second.
Dropbox notes that a quorum write would have cut retries, and that it chose the simpler all-replicas-or-retry rule anyway. The post's general stance is to avoid distributed consensus wherever a well-built central coordinator will do. The price is a ceiling: one Master can manage roughly 100 PB, which is one reason to have many cells.
Replication first, erasure coding later, and repair
Fresh data is hot. Dropbox's 2019 figures say more than 40% of file retrievals are for data uploaded in the last day and more than 90% for data from the last year. So new blocks go into replicated volumes, where every OSD holds a full copy and any one of them can serve a read.
Full copies are expensive. A 2023 article by a Dropbox engineer describes replicated volumes as four copies each. Once a volume fills and closes, it becomes eligible for erasure coding in the background. The same article gives Reed-Solomon 6+3 as an example: six data extents and three parity extents on nine OSDs, 1.5 times the raw data, and able to rebuild what a failed OSD held. It also describes local reconstruction codes, which cut overhead to roughly 1.33 times and make the common single failure cheaper to repair. Dropbox's 2016 post says its production code is a Reed-Solomon variant of that kind.
The encoding keeps each block whole on one OSD, so a normal read still touches one disk. Only when that OSD is unavailable does the system rebuild the block from the others.
Repair is the Master's most important job. In the 2016 design, when an OSD has been offline for 15 minutes, the Master closes every volume it held, plans which OSDs to copy from and to, and has volume managers move the data. Each OSD shares its volumes with hundreds of other OSDs, so the rebuild is spread across many disks and network cards. The move is committed by raising the volume's generation number and updating the Replication Table. If the old OSD comes back, its stale generation shows that its copy is out of date.
The migration and how it was verified
Dropbox published the dates. All are from the March 2016 announcement.
| When | What happened |
|---|---|
| Summer 2013 | Magic Pocket becomes a major project, after a small prototype. |
| August 2014 | Dark launch: data is mirrored between two regional locations. Extra backups are kept for about six more months. |
| 27 February 2015 | For the first time, user files are stored and served exclusively in-house. |
| 30 April 2015 | "BASE Jump": servers are installed in three regions fast enough to keep up, with data moving at a peak of over half a terabit per second. |
| 7 October 2015 | 90% of user data is served in-house, ahead of the 30 October target. |
Staying correct afterwards is the job of the verifiers, described in July 2016. Dropbox said that with over half a million disks in production, "your disks are lying to you": bad sectors, silent corruption, flushes that never reach the platter. Its response was to spend more than half of all disk and database workload on its own verification traffic.

| Verifier (2016) | What it checks |
|---|---|
| Disk Scrubber | Reads every bit on every disk and compares checksums, a full sweep roughly every one to two weeks. |
| Metadata Scanner | Walks the Block Index at about a million blocks per second and asks the storage nodes whether each block is really there, about once a week. |
| Storage Watcher | A black-box check written by someone who did not build the system. It samples 1% of written blocks and fetches them again after a minute, an hour, a day, a week and a month. |
| Trash Inspector | Deleted extents go to a trash area first. Each block in them must be confirmed as safely moved or genuinely deleted, and the extent is kept one more day after passing. |
| Extent Referee | Watches every file move or delete on a storage node and alerts if it does not match an approved instruction. |
| Cross-zone Verifier | Walks the file metadata outside Magic Pocket and checks that every block a user's file needs exists in the zones it should. |
New code runs on a staging cluster of tens of petabytes, with the verifiers, for at least a week before release. Dropbox also tested the verifiers themselves: in one exercise an engineer secretly corrupted staging data, and the team found every fault except two that the system had already repaired.
Dropbox's durability model, a Markov model of disk failures and repair times, produced 27 nines in 2016. The same post says plainly that it does not rely on that number, because software bugs, operator mistakes and bad configuration are far likelier to lose data than random disk failures.
What changed over time
- 2018: shingled disks. Dropbox described itself as the first major technology company to adopt SMR drives, which pack tracks closer by forcing sequential writes. That suits append-only data. With 14 TB drives a storage host reached 1.4 PB.
- 2019: a cold tier. Rarely read blocks are split into two fragments plus an XOR parity fragment, one per region across three regions. Any two rebuild the block. Dropbox reported 25% less disk than keeping full copies in two regions.
- 2023: scale. The 2023 article reports more than 600,000 drives, tens of millions of requests per second including background work, and cells that can exceed 100 PB.
- 2026: compaction. A closed volume is never reopened, so deleted blocks leave holes until live data is copied into a new volume. In April 2026 Dropbox described how a new encoding service left some volumes less than 5% full, and how it added new compaction strategies to reclaim the space.
The computer science underneath
Object storage and content addressing. Magic Pocket is at heart a key-value store whose values are large and immutable. Naming a block by its hash makes writes idempotent: storing the same bytes twice is a no-op. Object storage and blobs covers this model, and design a file sync service shows the layer above, where files become lists of block hashes.
Replication against erasure coding. Replication stores whole copies: simple and fast to read, but each copy costs 100% more disk. Erasure coding splits data into k pieces, computes m parity pieces, and can lose any m of them. It is the idea behind parity in RAID levels, stretched across machines. Designing a storage cluster explains the costs: reads during a failure and repairs both need several pieces.
Durability arithmetic. Counting nines turns failure rates and repair times into a probability. Availability, latency and the nines shows the arithmetic, and Magic Pocket shows its limit: the model only covers the failures you thought to model.
What an interviewer could ask from this
Why replicate first and erasure code later? New data is read often and is still being appended to. Replicas give cheap reads and simple writes. Once a volume is closed, erasure coding cuts storage from several full copies to about 1.3 to 1.5 times.
Why one Master per cell and not a consensus cluster? The Master is off the data path and keeps no authoritative state, so losing it does not stop reads. A single coordinator makes placement and repair decisions simple. The cost is a size limit per cell, handled by adding cells.
How do you know a migration of this size lost nothing? Mirror first and compare. Keep the old copy for months. Then verify continuously at several layers: bits on disk, index against storage, end-to-end fetches, and cross-zone checks driven from the file metadata.
What happens when a storage machine dies? After a short grace period its volumes are closed, copies are rebuilt on other machines from the surviving replicas or erasure coded pieces, and a generation number is raised so the old machine's copy is known to be stale.
Takeaways
- Dropbox moved file data in-house for performance and cost at its scale, and kept using a public cloud where that still made sense.
- Small immutable blocks, grouped into volumes that are either open for writes or closed for everything else, keep live traffic and background work apart.
- Replication suits hot data and erasure coding suits the rest. Moving data from one to the other as it ages is where the savings come from.
- A durability figure from a model is a starting point. Verification that reads everything back, continuously, is what justifies trusting the system.
- Migrate by running both systems side by side and keeping the old copy longer than feels necessary.












