Future: edge database
This course examines the claim that an edge database will make an application faster. It starts from the speed of light in fiber, about 200 km per millisecond, and uses it to compute round-trip floors. It shows why the number of sequential queries outweighs distance. It then explains why reads move near users easily while writes need a primary, and what breaks when writes are far. It closes with the categories of product on offer, the two cases where an edge database fits, and an ordered plan for a Rails team.
What you'll learn
- ✓Computing round-trip floors from the speed of light in fiber
- ✓Counting the longest chain of dependent queries in a request
- ✓Why reads scale with copies and writes scale with agreement
- ✓Read-after-write, sessions, uniqueness and open transactions when writes are far
- ✓Three categories of edge database and what each one charges
- ✓An ordered list of steps for a Rails team
The pitch and the physics
Someone forwards a link in the engineering channel and writes "we should move to an edge database". The page they linked is good. It talks about putting your data close to your users, and it isn't lying about anything.
Read the full lesson free →Curriculum
7 lessonsThe pitch and the physics
Uses the speed of light in fiber to compute round-trip floors between São Paulo, Ashburn, London and Sydney.
Round trips, not distance
Shows how sequential queries multiply the round-trip floor and how to find the longest dependent query chain.
Reads move, writes do not
Explains why any copy can serve reads while writes need one primary or a conflict resolution policy.
What breaks when writes are far
Covers read-after-write, sessions, uniqueness and chained Active Record writes when the primary sits far from users.
The categories on offer
Compares near read replicas, embedded SQLite copies and distributed SQL by what each does to reads and writes.
The honest answer, and the two real cases
Presents CDN assets, fewer round trips and one well-placed database as the default, plus read-heavy and residency cases.
What a Rails team does first
Turns the course into six ordered steps for a Rails team and reviews this application's single Postgres setup.