You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode CDNs: how most requests to a website never reach its servers

What happens when a website goes viral: how a site keeps up with millions of visitors

Read replicas: how a database is copied when every copy must agree

A website reads from its database much more often than it writes. So you make copies of the database to share the work. But someone saves a change. Which copy gets the change, and when do the other copies learn about it?

  1. 1 Look at what still reaches the database. Most requests only read: show my streak, show today's best players. Far fewer write: save this guess, add this score.databasereadwrite

    Look at what still reaches the database. Most requests only read: show my streak, show today's best players. Far fewer write: save this guess, add this score.

  2. 2 One database cannot keep up with all those reads and writes. Copies of it could share the work, but only if every copy says the same thing.Miva: 12 daysMiva: 11 days?

    One database cannot keep up with all those reads and writes. Copies of it could share the work, but only if every copy says the same thing.

The rest of this episode is for subscribers

Subscribe to read every premium episode. You can cancel when you want.

Paid yearly: $99 instead of $119.88

Next episode Message queues: how a website takes a flood of slow jobs without slowing down

Share this comic

More comics