Skip to content

Learn system design by running it.

Lessons, a simulator and graded challenges, all in your browser.

Readyengine 2.0.0

A cache-aside system: clients reach a load balancer, two services read from a cache, and misses fall through to the database.Clients1,500 req/sLBround robinsvc-1cache-asidesvc-2cache-asideCacheLRU · 2 MBDatabase5 workershot keys stay warmmisses fall through
Sim clock
—
Served
—
Failed
—
Goodput
—
Fig. 1The real engine, running the cache-aside template in your browser at 1,500 requests a second. Six seconds in, the cache dies for three; dots are 2% of requests, teal to the cache, red to the database.

§1Life of a request

One read, browser to database and back.

Scroll to trace user:42.

BrowserGET /users/42DNSresolverCacheuser:42CDN edgepass-throughLBround robinsvc-1cache-asideDatabase5 workerswhere is the API?personal, so pass it onround robin → svc-1MISS user:42 · 503 µs3.63 ms in the databaseSET user:42HIT · 809 µs end to end
  1. Browserbefore the data centre

    Someone opens their profile

    One read, GET /users/42. Scroll to send it.

  2. DNSbefore the data centre

    First, an address

    The browser asks a resolver where the API lives.

  3. CDN edgebefore the data centre

    The edge cannot answer this one

    A profile is personal, so the edge passes it on.

  4. Load balancer151 µs

    Pick a service

    Round robin picks svc-1. 151 µs on the server so far.

  5. Cache503 µs

    Ask the cache first. Miss.

    svc-1 asks the cache for user:42. Nobody has read it lately.

  6. Database4.34 ms

    The slow part

    The read takes 3.63 ms. Five workers; extra reads queue.

  7. Response4.9 ms

    Fill the cache, then answer

    svc-1 fills the cache and replies. 4.9 ms on the server.

  8. The next read809 µs

    A hit, 6× faster

    Served from cache in 809 µs. The database never hears.

§4How a verdict reads

Fixed pass bar, fixed seeds, every check explained.

Attempt this challenge

Inspection slip

cache-aside-recovery

Keep reads fast through a cache restart

Pass bar
CheckMust be
Goodput≥ 99%
p99 latency of successes≤ 80 ms
No write takes effect twice0 violations
Monthly cost≤ $400
Passed ★★★
Fig. 3The first challenge's pass bar.