Skip to content
SD-16 · NEARBY PLACES AND FRIENDS · INTERACTIVE

Break it.
Then fix it.

Turn up the number of people with the app open and watch search and nearby friends break in different places. Every switch is a decision from the write-up.

CHALLENGEReach 10 million live sharers with search p99 under 100 ms, friend updates within 5 s, and no errors.
StatusDOWNAt 1M users
Search p99500+ msTarget under 100 ms
Friend delay3 sPushed over sockets
Errors18.3%Monthly cost $3,420
PhonesLIVE
1.7K searches/s · 33K moves/s
traffic source
Load balancerOK
Autoscales search servers
spreading 1.7K/s
Search servers × 2OK
Searches only
1.7K / 6.0K req/s
Places DBDOWN
Geohash cells + locations
37K / 30K reads/s
WebSocket servers × 10OK
100K sockets each
1.0M open sockets
Pub/sub × 2HOT
Channel per user
333K / 400K msgs/s
The database is drowning in locations. 33K location writes a second land in database rows that are useless after 10 minutes. Keep the latest point in a cache with a TTL.
9Cells per searchThe point’s geohash cell and its 8 neighbours, so nothing across an edge is missed.
6 GBWhole geo indexSmall enough to copy to every cache replica instead of sharding it by region.
334KMoves a second10 million phones every 30 s. None of it touches a database on the live path.
×10Fan-outEach move reaches about 10 online friends: 3.34 million messages a second.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.