Skip to content
SD-45 · PHOTO LIBRARY · INTERACTIVE

Break it.
Then fix it.

Turn up the uploads on New Year’s Eve, watch what melts, and add the parts a real photo library needs. Every switch is a decision you would defend in an interview.

CHALLENGETake 20K uploads/s (and 400K thumbnail views/s) with timeline p99 under 150 ms and no errors.
StatusSTRAINEDAt 5K uploads a second
Timeline p9991 msTarget under 150 ms
Errors0%Nothing dropped
Stored per day1.3 PBEach photo stored once
PhonesLIVE
5.0K new photos/s · 100K views/s
5.0K upload attempts/s
Load balancerOK
API calls
spreading 457K ops/s
API servers × 131OK
Carrying photo bytes
457K / 655K ops/s
Object storageOK
Originals + thumbnails
120K / 300K req/s
Metadata DBHOT
One leader
17K / 20K ops/s
One metadata database can’t keep up. 17K ops a second against a limit of 20K. Every query is about one user’s library, so split it into 16 shards by user_id.
30%Duplicate attemptsReinstalls and second devices; a hash check skips them.
30×Resize vs row writeThumbnails belong on a queue, not in the upload call.
95%Views from the edgeA thumbnail never changes, so the CDN keeps it a year.
1.1 EBOriginals in 5 yearsStorage tiers and dedupe decide the bill.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.