Section 5 of 9
State
Data, Concurrency and Distribution
The hardest bugs live where data is stored, shared or spread across machines.
Why it matters when agents do the typing
Lost updates, duplicate charges, stale reads and unrecoverable data rarely show up in a demo or a single-user test. They show up under real concurrency, real network failures and real data volumes, where the people who own the system get paged and the users get hurt. Understanding transactions, races and partial failure is how you find these bugs before your users do.
The course: 4 lessons, about 38 minutes of reading, in the order below.
-
5.1
Data Modeling and Databases
Core 11 · Depth: do
Designing schemas, keys and constraints, choosing the right kind of store, and understanding how a database finds data quickly.
A mistake it teaches you to catch: Lists stored as comma-separated strings or opaque JSON blobs, making queries slow and integrity impossible to enforce.
Lesson: What the Schema Promises 10 min
-
5.2
Transactions and Consistency
Core 12 · Depth: do
Making multi-step changes all-or-nothing, and understanding what concurrent readers and writers can see.
A mistake it teaches you to catch: A read-modify-write on a balance or counter with no transaction or lock, losing updates under concurrent requests.
Lesson: Two Requests, One Row 10 min
-
5.3
Concurrency and Race Conditions
Depth: explain
What goes wrong when many things happen at once, within one process or across many workers: races, deadlocks and overload.
A mistake it teaches you to catch: Check-then-act races, such as checking stock and then decrementing it in two separate steps.
Lesson: When Things Happen at Once 8 min
-
5.4
Distributed Systems and Partial Failure
Core 13 · Depth: do
When work spans machines, any step can fail, stall or happen twice, and the design has to assume it will.
A mistake it teaches you to catch: Retries without idempotency that charge a customer twice when the first attempt had actually succeeded.
Lesson: The Call That Might Have Worked 10 min
Section test: State
10 questions across the 4 lessons above. Take it after the course; each answer explains itself.