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
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
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