Senior Track Roadmap

Architecture: multi-region database

This course examines what a second region would require for a Rails application running on one VPS, with Postgres and uploaded files on the same disk. It covers the physics of cross-continent latency, four measurements to take before building anything, and why object storage and a CDN come first. It then explains read replicas in Rails, replication lag and read-your-own-writes, four consistency models alongside CAP and PACELC, and an ordered plan with a clear point to stop after each step.

What you'll learn

  • ✓Finding every place an application stores state before replicating it
  • ✓Measuring user RTT, round trips per page, database share and read/write ratio
  • ✓Configuring a read replica in Rails and choosing which databases stay regional
  • ✓Handling replication lag, read-your-own-writes and background job reads
  • ✓Choosing a consistency model per operation, with CAP and PACELC in context
  • ✓Ordering the work: object storage, CDN, edge cache, then a replica
Free preview · Lesson 1 4 min read

One VPS, one region

Multi-region questions are easier to answer from a known starting point. Here is this application's, from config/deploy.yml.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...