Skip to content
SD-50 · LIVE LIKES · INTERACTIVE

Break it.
Then fix it.

Turn up the likes, watch what melts, and add the parts a real like button needs. 30% of every second’s likes land on one viral post. Every switch is a decision you would defend in an interview.

CHALLENGETake 100K likes/s, 30K on one post, and show watchers the count within 2 s with no errors.
StatusDOWNAt 20K likes per second
Count delay31 sTarget 2 s or less
Errors83.3%Likes or pushes dropped
Monthly cost$7,6206 API servers
UsersLIVE
20K likes/s · 1.0M watching
traffic source
Like API × 6OK
Likes only
20K / 30K req/s
Like records · 16 shardsOK
Keyed by post
6.0K / 10K writes/s on the hot post
Count storeDOWN
UPDATE per like, hot row
6.0K / 1K on one row
Gateways × 16OK
1 push per post per second
500K pushes/s
The hot post’s count row is locked. 6.0K likes a second each run `UPDATE like_count + 1` on one row, which takes about 1,000. Send each like as an event and let workers write the count once a second.
1,000/sOne row’s limitA locked counter row takes about 1,000 updates a second; the hot post needs 30,000.
1/sCount writes per postWorkers add up a second of events, however many likes it held.
60BPushes if uncoalesced30,000 likes × 2M watchers a second. Coalesced: about 2.5M.
99%Cache hitsWorkers write through every second, so the cache never needs invalidating.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.