Senior Track Roadmap

System Design: CAP theorem

This course covers the CAP theorem using a Rails application that runs on one PostgreSQL node. It starts with why CAP does not apply to a single node and how unique indexes provide the guarantees. It then reads the theorem's definitions and proof, corrects five common misreadings, and separates CAP availability from operational availability. Later lessons show PostgreSQL replication settings as a dial, compare real systems by conflict cost, and end with a per-operation table of partition behavior recorded in an ADR.

What you'll learn

  • ✓Why a single PostgreSQL node falls outside CAP
  • ✓The precise definitions of consistency, availability and partition tolerance
  • ✓Five common misreadings of the theorem and their corrections
  • ✓CAP availability versus operational availability, and where latency fits
  • ✓PostgreSQL synchronous replication settings as a consistency dial
  • ✓Choosing partition behavior per operation by conflict cost
Free preview · Lesson 1 5 min read

CAP does not apply here

The CAP theorem is about distributed systems. This application isn't one, and understanding why takes you most of the way to understanding the theorem.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...