ADR-0012: Use PostgreSQL for the orders service
Status: Status
Date: 12 March 2027
Decision makers: Platform team lead, orders team lead, security engineer
Context
The orders service stores 20 million rows and needs transactions across tables. The current store has no transaction support and the team has no experience running it.
What matters most
Data consistency
Team experience
Running cost
Ability to scale to 5x in two years
Options considered
1. PostgreSQL, managed. Strong transactions, team knows it, higher cost.
2. A document database. Fast to start, weaker joins and transactions.
3. Stay with the current store. No migration, but the problem remains.
Decision
We will use managed PostgreSQL for the orders service.
Why
It meets the consistency need, the team can support it, and cost is acceptable within the platform budget.
Consequences
Good: simpler code and safer orders. Bad: a three month migration and a yearly hosting cost. We must plan the data move and a rollback.
When to revisit
If volume passes 100 million rows or hosting costs double.
Related
Replaces ADR-0004. Related: ADR-0009.