Skip to content

Design a Distributed Cache (Memcache)/Playground

A look-aside cache at Facebook's scale

Click a part to change it, put something in front of it, or kill it. Turn the traffic up. Every number moves as you go; nothing is graded. Billions of reads a second fleet-wide; scaled down here to one cluster, with a 1% miss rate assumed.

Running
Traffic
CLIENTUsersSERVICEWeb serversSERVICEmcrouterCACHEmemcached poolCACHEGutter poolDATABASEMySQLWORKERInvalidationdaemon
Requests failing
0%
Backlog growing
none
Instances running
877

What goes through it

OperationOfferedOutcomeWaitUp
Key reads1.5M/sAll served214 ms99.999%
Misses to MySQL15k/sAll served6 ms99.999%
Writes3,000/sAll served13 ms99.999%
Invalidationsbackground3,000/sKeeping up––

Wait is the expected time a caller waits; Up is the share of time every part it waits on is running.

What your changes did

Nothing yet. This is the reference design: change something to see what it buys and costs.

At this traffic

Everything is running within capacity.

Ask AI what your design does

AI

The numbers above come from a simple model. The AI reads your design, what you changed and these numbers, and explains where it holds and where it fails, citing how the engineers who built it did it. It can be wrong.