Now Reading
Dropbox’s Exabyte-Scale Blob Storage System

Dropbox’s Exabyte-Scale Blob Storage System

2023-05-16 01:49:30

Key Takeaways

  • Magic Pocket is a horizontally scalable exabyte-scale blob storage system and is ready to keep 99.99% availability and very excessive sturdiness.

  • The system can run on any HDDs, however primarily runs on Shingled Magnetic Recording disks. It could actually deal with tens of millions of queries per second and routinely establish and restore a whole bunch of {hardware} failures per day.

  • Every retailer storage system can comprise 100+ drives. Every storage system shops a number of petabytes of information.

  • Utilizing erasure codes and different optimizations, Dropbox is ready to cut back replication prices whereas sustaining comparable sturdiness as replication.

  • Forecasting is essential to take care of the problem of storage progress and capability points similar to coping with provide chain disruptions.

At QCon San Francisco, I defined how the exabyte scale blob storage system that shops all of Dropbox’s buyer information works. At its core, Magic Pocket is a really giant key-value retailer the place the worth will be arbitrarily sized blobs.

Our system has over 12 9s of sturdiness and 99.99% of availability, and we function throughout three geographical areas in North America. Our methods are optimized for 4 MB blobs,  immutable writes, and chilly information. 

Magic Pocket manages tens of tens of millions of requests per second and a variety of the site visitors comes from verifiers and background migrations. We’ve got greater than 600,000 storage drives at the moment deployed and we run 1000’s of compute machines.

Object Storage Machine

The principle focus of the Magic Pocket is the Object Storage Units (OSD). These units have over 2 PB of capability and are made up of round 100 disks per storage machine, using Shingled Magnetic Recording (SMR) know-how.

SMR differs from Typical Magnetic Recording drives because it performs sequential writes as an alternative of random writes, permitting elevated density.

The tradeoff of utilizing SMR is that the pinnacle erases the subsequent monitor once you stroll over it, stopping random writes in anyplace.

Nonetheless, that is good for our workload patterns. SMR drives even have a standard zone that permits for caching of random writes if mandatory, which usually accounts for lower than 1% of the whole capability of the drive.

Determine 1: SMR Observe Structure

At a excessive degree, the structure of Magic Pocket consists of three zones: West Coast, Central, and East Coast. The system is constructed round pockets, which signify logical variations of the whole lot within the system. Magic Pocket can have a number of cases, similar to a check pocket or a stage pocket earlier than the manufacturing one. Databases and compute usually are not shared between pockets, and function independently of one another.


These are the completely different parts of the Magic Pocket structure in every zone.

Determine 2: How a zone works

The primary service is the frontend, which is the service that interacts with the purchasers. Shoppers usually make PUT requests with keys and blobs, GET requests, delete calls, or carry out scans for obtainable hashes within the system. 

When a GET request is made, the hash index, a set of sharded MySQL databases,  is queried. The hash index is sharded by the hash, which is the important thing for a blob, and every hash is mapped to a cell or a bucket, together with a checksum. The cells are the isolation models the place all of the storage units are situated: they are often over 100 PBs and develop as much as particular limits in dimension. When the system runs low on capability, a brand new cell is opened up, permitting for horizontal scaling of the system.

The cross-zone replicator is the element performing cross-zone replication, storing information in a number of areas. The operation is finished asynchronously, and as soon as a commit occurs within the major area, the info is queued up for replication to a different zone. The management aircraft manages site visitors coordination, generates migration plans, and handles machine re-installations. It additionally manages cell state data.


If I wish to fetch a blob, I have to entry the bucket service that is aware of about buckets and volumes: once I ask for a bucket, my request is mapped to a quantity and the quantity is mapped to a set of OSDs. 

Determine 3: How a cell works

As soon as we discover the OSD that has our blob, we are able to retrieve it. For writing information, the frontend service figures out which buckets are open for writing and it commits to those which can be prepared. The buckets are pre-created for us, and the info is saved in a set of OSDs inside a quantity.

The coordinator is a crucial element within the cell, managing all of the buckets, volumes, and storage machines. The coordinator continuously checks the well being of the storage machines, reconciles data with the bucket service and database, and performs erasure coding and repairs: It optimizes information by shifting issues round throughout the cell and takes care of shifting information to different machines when it’s mandatory. The quantity supervisor handles the studying, writing, repairing, and erasure encoding of volumes. Verification steps occur each inside and outdoors of the cell.

Buckets, Volumes, and Extents

We will now dive deeper into the parts of the Magic Pocket storage system, particularly buckets, volumes, and extents. 

Determine 4: Buckets, volumes, and extends

A bucket is a logical storage unit related to a quantity and extent, which represents 1-2 GBs of information on a disk. After we write, we establish the open buckets and the related OSDs after which write to the extents. The coordinator manages the bucket, quantity, and extent data, and may be certain that information just isn’t misplaced by discovering a brand new placement for a deleted extent. A quantity consists of a number of buckets, it’s both replicated or erasure coded, and it’s open or closed. As soon as a quantity is closed, it’s by no means opened up once more.

Find out how to Discover a Blob in Object Storage Units

On this chapter, we discover ways to discover a blob in a storage machine. To do that, we retailer the handle of the OSDs with the blob, and we discuss on to these OSDs. 

Determine 5: Discovering a Blob

The OSDs load up all of the extent data and create an in-memory index of which hashes they need to the disk offset. If we wish to fetch the block, we have to know the quantity and which OSDs have the blob. For a PUT, it is the identical course of, however we do a write to each single OSD in parallel and don’t return till the write has been accomplished on all storage machines. As the quantity is 4x replicated, we’ve the complete copy obtainable in all 4 OSDs.

Erasure Coding

Whereas failures are taking place on a regular basis, 4 copies by 2 zones replication is dear. Let’s have a look at the distinction between a replicated quantity and an erasure-coded quantity, and the way to deal with it. 

Determine 6: Erasure Coding

Erasure coding is a option to cut back replication prices whereas sustaining comparable sturdiness as replication. In our system, when a quantity is sort of full, it’s closed and eligible to be erasure coded. We use an erasure code, like Reed Solomon error correction 6 plus 3, with 6 OSDs and three parities in a quantity group. This implies there’s a single blob in a single information extent, and if one OSD fails, it may be reconstructed. Reconstructions can occur on reside requests for information or carried out within the background as a part of repairs. There are a lot of variations of erasure codes with completely different tradeoffs round overhead: for instance, utilizing XOR as an erasure code will be easy, however customized erasure codes will be extra appropriate. 

Determine 7: Failure and erasure coding

The paper “Erasure Coding in Windows Azure Storage” by Huang and others is a helpful useful resource on the subject, and we use comparable methods inside our system.

Determine 8: Reed Solomon error correction by “Erasure Coding in Windows Azure Storage” by Huang et al

I beforehand talked about an instance of Reed Solomon 6, 3 codes with 6 information extents and three parities. An alternative choice is named native reconstruction codes, which optimizes learn value. Reed’s 6, 3 codes lead to a learn penalty of 6 reads when there are any failures. Nonetheless, with the native reconstruction codes, you may have the identical learn prices for one sort of information failure however with a decrease storage overhead of roughly 1.33x in comparison with Reed Solomon’s 1.5x replication issue. Though this may occasionally not look like an enormous distinction, it means vital financial savings on a bigger scale. 

Determine 9: Reconstruction code comparisons from “Erasure Coding in Windows Azure Storage” by Huang et al

The native reconstruction codes optimize for one failure throughout the group, which is normally what you encounter in manufacturing. Making this tradeoff is suitable as a result of greater than 2 failures in a quantity group are uncommon. 

Even decrease replication elements are doable with these codes: the LRC-(12,2,2) code can tolerate any three failures throughout the group, however not 4, with just some failures that may be reconstructed.

The Chilly Storage System

Can we do higher than this for our system? As we’ve noticed that 90% of retrievals are for information uploaded within the final yr and 80% of retrievals occur throughout the first 100 days, we’re exploring methods to enhance our cross-zone replication

Determine 10: File entry distribution

As we’ve a considerable amount of chilly information that isn’t accessed incessantly, we wish to optimize our workload to scale back reads and keep comparable latency, sturdiness, and availability. To realize this, we observe that we don’t have to do reside writes into chilly storage and may decrease our replication issue from 2x by using multiple area. 

Let’s see how our chilly storage system works, with the inspiration coming from Fb’s warm blob storage system. The f4 paper suggests a technique to separate a blob into two halves and take the XOR of these two halves, that are saved individually in numerous zones. To retrieve the complete blob, anyone mixture of blob1 and blob2 or the XOR have to be obtainable in any two areas. Nonetheless, to do a write, all areas must be absolutely obtainable. Be aware that because the migrations occur within the background and asynchronously, they don’t have an effect on the reside course of.

See Also

Determine 11: Splitting blobs and chilly storage

What are the advantages of this chilly storage system? We’ve got achieved a 25% financial savings by decreasing the replication issue from 2x to 1.5x. The fragments saved in chilly storage are nonetheless internally erasure-coded, and migration is finished within the background. To cut back overhead on spine bandwidth, we ship requests to the 2 closest zones and solely fetch from the remaining zone if mandatory. This protects a big quantity of bandwidth as effectively.

Launch Cycle

How can we do releases in Magic Pocket? Our launch cycle takes round 4 weeks throughout all staging and manufacturing environments. 

Determine 12: Magic Pocket’s launch cycle

Earlier than committing modifications, we run a sequence of unit and integration checks with all dependencies and a sturdiness stage with a full verification of all information. Every zone has verifications that take a couple of week per stage: our launch cycle is absolutely automated, and we’ve checks in place that can abort or not proceed with code modifications if there are any alerts. Solely in distinctive instances can we cease the automated deployment course of and need to take management.


What about verifications? Inside our system, we conduct a variety of verifications to make sure information accuracy. 

Determine 13: Verifications

One among these is carried out by the cross-zone verifier, which synchronizes information mappings between purchasers upstream and the system. One other is the index verifier, which scans the index desk to verify if particular blobs are current in every storage machine: we merely ask if the machine has the blob primarily based on its loaded extents, with out really fetching the content material. The watcher is one other element that performs full validation of the blobs themselves, with sampling carried out after one minute, an hour, a day, and every week. We even have the trash inspector, which ensures that every one hashes inside an extent are deleted as soon as the extent is deleted.


With Magic Pocket we take care of numerous migrations since we function out of a number of information facilities. We handle a really giant fleet of storage machines, and it is necessary to know what’s taking place on a regular basis. There’s a variety of automated chaos happening, so we’ve tons of catastrophe restoration occasions to check the reliability of our system: upgrading at this scale is simply as troublesome because the system itself. Managing background site visitors is one in all our key operations because it accounts for many of our site visitors and disk IOPS. The disk scrubber continuously scans via the entire site visitors and checks the checksum for the extents. We categorize site visitors by service into completely different tiers, and reside site visitors is prioritized by the community. 

The management aircraft generates plans for lots of the background site visitors primarily based on forecasts we’ve a couple of information heart migration: we consider the kind of migration we’re doing, similar to for chilly storage, and plan accordingly.

We take care of a variety of failures in our system: we’ve to restore 4 extents each second, which will be anyplace from 1 to 2 GBs in dimension. We’ve got a reasonably strict SLA on repairs (lower than 48 hours) and, as it’s a part of our sturdiness mannequin, we wish to preserve this restore time as little as doable. Our OSDs get allotted into the system routinely primarily based on the scale of the cell and present utilization. 

We even have a variety of migrations to completely different information facilities.

Determine 14: Migrations

Two years in the past, we migrated out of the SJC area, and it took intensive planning to make it occur. For very giant migrations, like a whole bunch of PBs, there may be vital preparation happening behind the scenes, and we give ourselves further time to make it possible for we are able to end the migration in time. 


Forecasting is a vital a part of managing our storage system at this scale. We’re continuously coping with the problem of storage progress, which may typically be surprising and require us to rapidly adapt and soak up the brand new information into our system. Moreover, we might face capability points attributable to provide chain disruptions like these brought on by the COVID pandemic: as quickly as we establish any potential issues, we begin engaged on backup plans because it takes a substantial period of time to order and ship new capability to the info facilities. Our forecasts are immediately built-in into the management aircraft, which helps us execute migrations primarily based on the knowledge supplied by our capability groups.


Managing Magic Pocket, 4 key classes have helped us keep the system:

  • Shield and confirm
  • Okay to maneuver sluggish at scale
  • Preserve issues easy
  • Put together for the worst

In the beginning, we prioritize defending and verifying our system. It requires a big quantity of overhead, nevertheless it’s essential to have end-to-end verification to make sure consistency and reliability. 

At this scale, it is necessary to maneuver slowly and steadily. We prioritize sturdiness and take the time to attend for verifications earlier than deploying something new. We all the time take into account the dangers and put together for worst-case situations.

Simplicity can be a vital issue. We purpose to maintain issues easy, particularly throughout large-scale migrations, as too many optimizations can create a sophisticated psychological mannequin that makes planning and debugging troublesome. 

As well as, we all the time have a backup plan in case of failures or points throughout migrations or deployments. We be certain that modifications usually are not a one-way door and will be reversed if mandatory. General, managing a storage system of this scale requires a cautious stability of safety, verification, simplicity, and preparation.

Source Link

What's Your Reaction?
In Love
Not Sure
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top