4 Databases durable jobs and reliable automation
A relational database stores structured data and enforces constraints. PostgreSQL is appropriate when you need multiple clients, transactional updates, indexes, and mature operations.
- Choose storage by the contract
- SQL concepts
- Schema changes without breaking a release
- Connections and transactions
- The job state machine
- Delivery semantics
- Webhook receiver design
- Schedules and time
- Backup and restore
- Exit exercise
Outcome: reason about persistence, duplicate delivery, retries, and recovery. Prerequisites: the local project. Environment: SQLite for introductory work and the PostgreSQL Compose deployment for operational exercises. A relational database stores structured data and enforces constraints. PostgreSQL is appropriate when you need multiple clients, transactional updates, indexes, and mature operations. SQLite is useful for local and embedded workloads with a different concurrency and deployment model. A cache speeds reads but should not silently become the only copy of important data. Object storage holds blobs such as reports or uploaded files; store their metadata and access policy separately. Define what must remain true before choosing a product.