retrystorm · Learn · Interview practice · Glossary · Components

Home › Interview practice › A Fast Home Page

A Fast Home Page

The home page waits on a recommendations store that's sometimes very slow. Keep the page fast without dropping the box.

Inkwell's new home page shows a writer's notes, from the database, and a box of recommendations, from a key-value store another team runs. The store usually answers in a few milliseconds, but now and then it takes a quarter of a second or more, and the page waits for it.

The product team's budget: 99% of requests under 100 ms, and recommendations shown on almost every page.

What it does

  • Read: a writer opens the home page: their notes, and recommendations.
  • Write: a writer saves a note.

Workload

A steady 1 000 rps, 90% reads / 10% writes, for 20 seconds, against 10 000 notes.

How to build it

  1. Build client, load balancer, app server. Connect the app server to a relational database (notes) and a KV store (recommendations).
  2. Run it and look at the p99.
  3. Select the connection from the app server to the KV store. Decide whether the page really needs it (If it fails: fail the request, or skip it) and how long it should wait (Timeout).

Part of Chapter 8: Latency Budgets.

About · Contact · Privacy · Terms of use