HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

How We've Scaled Dropbox

Stanford5 HN recommenders · recommended in 5 months, 2014-2023
YouTube
372K views · 14 years ago · talk · dated

Dropbox engineer Kevin Modzelewski gives a Stanford colloquium on Dropbox's history and the technical problems it faced scaling, including detailed database schema decisions.

Recommended as a detailed, candid case study of scaling a real system from zero users to millions.

Distributed systemsDatabases & storageCloud, DevOps & reliability#scaling#dropbox#databases#systemarchitecture#mysql

8 comments from Hacker News

@srcreigh2023 · in “Ask HN: It's 2023, how do you choose between MySQL and Postgres?”

Postgres is >50x slower for range queries(example below) and is akin to using array-of-pointers (ie Java) whereas MySQL supports array-of-struct (C). Illustration from Dropbox scaling talk below. Sneak peek photo [1] (from [2]). Just imagine its literally 500-1000x more convoluted per B-tree leaf node. That's every Postgres table unless you CLUSTER periodically. [1]: link [2]: link Mind boggling how many people aren't aware of primary indexes in MySQL that is not supported at all in Postgres. For certain data layouts, Postgres pays either 2x storage (covering index containing every single column), >50x worse performance by effectively N+1 bombing the disk for range queries, or blocking your table periodically (CLUSTER). In Postgres the messiness loading primary data after reaching the B-tree leaf nodes pollutes caches and takes longer. This is because you need to load one 8kb page for every row you want, instead of one 8kb with 20-30 rows packed together. Example: Dropbox file history table. They initially used autoinc id for primary key in MySQL. This causes everybodys file changes to be mixed together in chronological order on disk in a B-Tree. The first optimization they made was to change the primary key to (ns_id, latest, id) so that each users (ns_id) latest versions would be grouped together on disk. Dropbox scaling talk: ▶ this video If a dropbox user has 1000 files and you can fit 20 file-version rows on each 8kb disk page (400bytes/row), the difference in performance

CitesView on HN
@srcreigh2021 · in “How database indexing works internally”

An important detail which this guide leaves out: The "actual location of the row" is usually the leaf node of another B-Tree. That is the primary B-Tree and it's indexed by the primary key. The major consequence is every non-primary index query involves dereferencing N pointers, which could mean loading N pages from disk/SSD to get leaf nodes spread out across the primary tree. Whereas if you query a range in the primary B-Tree directly, the rows are consecutive so you would only load N/M consecutive pages based on the ratio of rowsize to pagesize. That's why some people use composite keys for primary key, to get better data locality in the primary B-Tree index. See "How We've Scaled Dropbox"[1] to hear the same thing. At 48:36 they explain why they changed from PRIMARY KEY (id) to PRIMARY KEY (ns_id, latest, id). ns_id is kinda like user_id. So that change groups journal entries for users together on disk Specifically. PRIMARY KEY (id) orders things by creation date whereas PRIMARY KEY (ns_id, latest, id) orders things by ns_id primarily. [1]: ▶ this video

CitesView on HN
@fermienrico2018 · in “How we rolled out one of the largest Python 3 migrations”

I found the Dropbox lecture [1] at Stanford one of the most riveting things ever. There is just so much technology behind Dropbox, it is staggering. There is a reason why it is so much better than iCloud sync, Google Drive, Box or OneDrive. [1] ▶ this video

Strongly recommendsView on HN
@testb2018 · in “Ask HN: Most effective path to become a solid systems practitioner?”

imo the best way is to look at what other's have built. Here's some of my favorite talks that go from 0 users to millions. Dropbox - ▶ this video Instagram - link Slack (bonus. not as applicable but good reminder of why initial architecture does matter) - link

RecommendsView on HN
@jesseendahl2018 · in “Congrats Dropbox”

Dropbox is a lot more than a GUI on top of rsync. Even purely from an engineering standpoint (ignoring product & design) that's incorrect. You might enjoy this talk: ▶ this video

RecommendsView on HN
@LrnByTeach2017 · in “Ask HN: Best-architected open-source business applications worth studying?”

> Applications don't really need to be well architected until they are hitting scale. very True, 'a system Well architected' before hitting scale is considered OVER Engineering > Then the parts of their system that need to relieve pressure will need to be re-architected. > This is almost like a case study and there are a lot of good talks on youtube from places like dropbox and facebook that explain the problem and solution. Example: ▶ this video

CitesView on HN
@bradgnar2017 · in “Ask HN: Best-architected open-source business applications worth studying?”

Applications dont really need to be well architected until they are hitting scale. Then the parts of their system that need to relieve pressure will need to be re-architected. This is almost like a case study and there are a lot of good talks on youtube from places like dropbox and facebook that explain the problem and solution. Example: ▶ this video If you dont want to do youtube case studies there are also books to read about distributed systems. Also reading about cloud architecture can help.

RecommendsView on HN
@rawnlq2014 · in “Facebook's software architecture”

This is a talk about the evolution of Dropbox's architecture from 2012: ▶ this video . It is incredibly detailed (down to the exact sql schema they use for file metadata etc).

RecommendsView on HN
Seattle Conference on Scalability: YouTube Scalability52:41

Seattle Conference on Scalability: YouTube Scalability

Google TechTalks
30K views • 19 years ago
Scaling the Linear Sync Engine1:06:08

Scaling the Linear Sync Engine

Linear
37K views • 3 years ago
NYC Tech Talk Series: How Google Backs Up the Internet1:14:19

NYC Tech Talk Series: How Google Backs Up the Internet

Google TechTalks
41K views • 12 years ago
"Turning the database inside out with Apache Samza" by Martin Kleppmann47:43

"Turning the database inside out with Apache Samza" by Martin Kleppmann

Strange Loop Conference
205K views • 12 years ago
AWS re:Invent 2018: Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321)53:43

AWS re:Invent 2018: Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321)

Amazon Web Services
112K views • 7 years ago
Rick Reed - WhatsApp: Half a billion unsuspecting FreeBSD users54:14

Rick Reed - WhatsApp: Half a billion unsuspecting FreeBSD users

iX
31K views • 11 years ago
Breakout Session Presented by Dan Robinson of Heap at PGConf Silicon Valley 201554:54

Breakout Session Presented by Dan Robinson of Heap at PGConf Silicon Valley 2015

Citus Data
14K views • 10 years ago
Mastering Chaos - A Netflix Guide to Microservices53:14

Mastering Chaos - A Netflix Guide to Microservices

InfoQ
2.3M views • 9 years ago
Building Software Systems At Google and Lessons Learned1:22:45

Building Software Systems At Google and Lessons Learned

Stanford
257K views • 15 years ago
Rich Hickey: Deconstructing the Database1:06:24

Rich Hickey: Deconstructing the Database

InfoQ
106K views • 14 years ago
Introduction to NoSQL • Martin Fowler • GOTO 201254:52

Introduction to NoSQL • Martin Fowler • GOTO 2012

GOTO Conferences
1M views • 13 years ago
AWS re:Invent 2018: How AWS Minimizes the Blast Radius of Failures (ARC338)55:44

AWS re:Invent 2018: How AWS Minimizes the Blast Radius of Failures (ARC338)

Amazon Web Services
37K views • 7 years ago
Greg Young — A Decade of DDD, CQRS, Event Sourcing48:04

Greg Young — A Decade of DDD, CQRS, Event Sourcing

Domain-Driven Design Europe
190K views • 10 years ago
Erlang Factory 2014 - That's 'Billion' with a 'B': Scaling to the Next Level at WhatsApp49:15

Erlang Factory 2014 - That's 'Billion' with a 'B': Scaling to the Next Level at WhatsApp

Erlang Solutions
50K views • 12 years ago
CRDTs and the Quest for Distributed Consistency43:39

CRDTs and the Quest for Distributed Consistency

InfoQ
68K views • 8 years ago
"I See What You Mean" by Peter Alvaro52:29

"I See What You Mean" by Peter Alvaro

Strange Loop Conference
59K views • 11 years ago
How Modern SQL Databases Come up with Algorithms that You Would Have Never Dreamed Of by Lukas Eder50:31

How Modern SQL Databases Come up with Algorithms that You Would Have Never Dreamed Of by Lukas Eder

Devoxx
55K views • 9 years ago
Scaling ZFS for NVMe - Allan Jude - EuroBSDcon 202246:00

Scaling ZFS for NVMe - Allan Jude - EuroBSDcon 2022

EuroBSDCon
14K views • 4 years ago
The past, present, and future of local-first - Martin Kleppmann (Local-First Conf)29:46

The past, present, and future of local-first - Martin Kleppmann (Local-First Conf)

Local-First Conf
17K views • 2 years ago
"Systems that run forever self-heal and scale" by Joe Armstrong (2013)1:10:23

"Systems that run forever self-heal and scale" by Joe Armstrong (2013)

Strange Loop Conference
85K views • 5 years ago