Design Dropbox: file chunking, sync, and storage
Dropbox
Guided ModeCDN: Fast Downloads Anywhere
Fetching chunks directly from S3 in us-east-1 adds 150–300ms latency for users in Asia or Europe. A CDN caches frequently-accessed chunks at edge nodes globally — most downloads become local cache hits, cutting latency to <20ms.
Request Flow
Device B requests chunk via CDN
Device B downloads file chunks from the CDN URL (e.g. dl.dropboxusercontent.com). The CDN checks if it has this chunk cached at the nearest edge.
GET https://dl.dropboxusercontent.com/chunk/a1b2c3
Cache miss: CDN fetches from S3
On a cache miss the CDN fetches the chunk from S3 as the origin. It caches it at the edge for subsequent requests by other users with the same file.
Cache hit: served at edge
All subsequent requests for the same chunk are served from CDN edge memory — no S3 round-trip. Because chunks are content-addressed by hash, the same popular chunk (e.g. a shared template) benefits thousands of users.
Why We Need This
S3 is a single-region origin store. The CDN is the delivery network. At Dropbox's scale, 80% of downloads are cache hits at CDN edges — significantly reducing both latency and S3 egress costs.
Key Insight
Content-addressed chunks are perfect for CDN caching: the cache key (chunk hash) is globally stable. The same 4 MB chunk of a popular shared document is cached once and served to thousands of devices.
Step 7 of 8
