Production¶
This chapter describes how FeeCheck's PostgreSQL database is set up and operated for production on Cloud SQL. It serves whoever installs or operates a FeeCheck environment that holds real data. For each topic it puts the proof of concept's working default next to the setting this chapter recommends for production, so the difference is visible. The proof of concept keeps its cost-saving defaults; nothing here changes the running instance.
How to read it¶
The PoC default column states what the proof of concept runs with, as set by
ADR-0013 (docs/adr/adr-0013-postgresql-on-cloud-sql.md) and applied by the
Cloud SQL guide (docs/guides/cloud-sql.md). It fits synthetic data, one person at a time and an
instance that may be lost.
The production setting column is this chapter's recommendation for an environment that holds real contracts or that someone besides the developer depends on. It is not a decision: ADR-0013 §7 keeps the region, the backups, the major version and the database roles open, and a production installation decides them in a record of its own. Where a setting needs code or configuration the backend does not have yet, the page says so.
Pages¶
- PostgreSQL: installation and setup — what is decided and set when the instance is created.
- PostgreSQL: operations manual — keeping, restoring and changing the data once it runs.
At a glance¶
| Topic | PoC default | Production setting |
|---|---|---|
| Region | europe-west6, beside the backend |
the installation's approved region, the same as the backend's |
| Major version | PostgreSQL 18, Cloud SQL's default | the newest version Cloud SQL offers as default, upgraded in place before its community end of life |
| Tier | db-f1-micro, shared core, outside the SLA |
a dedicated-core tier, sized by measured memory and connections |
| Network | private IP only | private IP only |
| Authentication | IAM database authentication, no password | the same, for people too |
| Database roles | one identity migrates on start and serves | a migration identity creates and owns the tables; the runtime account reads and writes rows only |
| Backups | off; deletion protection on | daily automated backups and point-in-time recovery; deletion protection on |
| Failed migration | the database is rebuilt or the table recreated | forward fix; restore when data is lost |
| Migrations during a deploy | may drop and recreate a table (the PoC reset mode) | each migration stays compatible with the previous revision |
| Connections | pool of 3, one instance, 25 admitted | the sum checked against the tier's limit before any number rises |
| Retention | soft delete, rows kept; the PoC reset mode on | soft delete; the reset mode off; backups bounded by the retention rule |
| NFR-4 | Cloud SQL's logging defaults | the same defaults, pinned as flags, with auditing limited to schema and role changes |
| Monitoring | four resources, the alert by email to the owner | the same four, the limits matched to the tier, the alert to an on-call group |
| Cost | about USD 10–13 a month | a dedicated tier plus backups, read from the region's price list |