Data models and transactionsCHAPTER 05
PART B / Data models and transactions
Step 100 of 252
CHAPTER 05GUIDED READING

Data models and transactions

Model authoritative state, inspect queries, and protect concurrent changes.

Decide what a row means and who may change it

Several people can read the same bookmark while each has their own read/unread state. Two buyers can also race for the last item in stock. These examples show why a correct-looking table and a transaction keyword do not by themselves enforce the product’s rules.

Model identity and access patterns first. Then inspect query plans and drive conflicting writes in two PostgreSQL sessions. Keep the supplied PostgreSQL lab separate from the starter API’s SQLite database. Explain both returned rows and rejected operations.

Parts group related chapters. Each lesson has a chapter.lesson address, such as 4.07. Open a title below, or use Next to follow the reading sequence. Within a lesson, On this page lists its sections.

  1. 5.01
  2. 5.02
  3. 5.03
  4. 5.04