Server-Side Applications & Databases

Overview


We have built a browser interface that requests, checks and displays API data. Part 3 follows those requests into the server. We will validate input, use PostgreSQL through shared repository modules, and separate request handling from application rules. Transactions, locks and an explicit clock then let us reason about changes made by more than one request.

Continue using the practice application (practice/) from Parts 1 and 2 for chapter examples. Keep that work separate from the marketplace project.

Part structure

Practice database progression

The practice application has its own database-migrations/ directory and database. Keep 001_create_todos.sql from the walking skeleton. The following chapters add small, independent resources to demonstrate different persistence decisions:

ChapterMigrationPurpose
3.4002_rooms.sqllab_rooms: move room reads from memory to PostgreSQL.
3.7003_stock.sqllab_stock: observe an atomic debit and credit between two rows.
3.8004_workshops.sqllab_workshops and lab_registrations: coordinate competing registrations.
3.9005_workshop_deadlines.sqlAdd an optional deadline to the existing workshops.

If you already added a migration, use the next unused numeric version and retain the same dependency order.