retrystorm · Learn · Interview practice · Glossary · Components

Home › Interview practice › Read the Archive

Read the Archive

Years of old blog posts, each read about as often as the next. Scale the reads, and spend the money where it helps.

Inkwell Blogs now has an archive: every post anyone has ever published, 200 000 of them. Readers arrive from search engines, each to a different old post, so no post is much more popular than any other. The database can't keep up, and the database team's plan is a big cache in front of it.

What it does

  • Read: a reader opens an archived post.
  • Write: an author fixes a typo in an old post.

Workload

A steady 12 000 rps, 99% reads / 1% writes, for 15 seconds, over 200 000 posts. Every post is about as likely to be read as any other.

How to build it

The app tier is fixed: twelve medium replicas behind a load balancer. Database nodes go up to the medium tier, as before. You can add read replicas, a cache, or both.

  1. Build the path: client, load balancer, app server, database. Run it as it is.
  2. Try the team's cache, then select it and check its hit rate under Metrics.
  3. Spend the money where it takes load off the database, and nowhere else.

Part of Chapter 21: Cache or Replicas.

About · Contact · Privacy · Terms of use