cloudpatterns.appClassroomKatasWhiteboardBlog
Data LineLesson

Read replicas for a read-heavy app

Copy the database to read-only replicas to spread the reads — every write still goes to the one primary, and a replica can lag behind it.

11 minMediumStation: Read replicas

Members lesson

Membership isn’t open yet. The free lessons are open — 16 of them.

  1. Users
  2. Users
  3. Load balancer
  4. Web API
  5. Web API
  6. Web API
  7. Database
From step 1 — The database needs about twice the CPU it has.

What you'll be able to do

  1. 1Predict the load on the primary and on each replica when reads are spread across N replicas.
  2. 2Explain replication lag and when a read from a replica can return stale data.
  3. 3Choose which reads may go to a replica and which must go to the primary.

Inside the lesson

steps
8
questions
9
simulations
2

You guess first, then run the system and see if you were right.

Step 1 · The setup

Pixel's feed is now read 360 times a second, while people post only 30 times a second. Every one of those requests goes to the same database.

Watch the database server's CPU bar.

Steps 2–8 are for members