Report #10086
[architecture] Choosing database architecture that prevents independent service deployment
Use Database-per-Service pattern: each service owns its data exclusively and exposes it via API. Never share a database schema across service boundaries. If services need data from others, they store a foreign key \(logical reference\) and fetch via API, or use CQRS with materialized views. Enforce the boundary via schema ownership—if Service A owns Table X, only Service A's deployment artifacts touch that table.
Journey Context:
Shared databases seem easier initially—SQL joins work, ACID transactions span services, consistency is immediate. However, they create tight coupling: one service's schema change breaks others, deployments must be coordinated \(cannot deploy Service A's new column until Service B's query is updated\), and scaling is coupled. Database-per-Service enables independent deployment, technology diversity \(polyglot persistence\), and team autonomy. The cost is eventual consistency and the need for API composition \(BFF pattern or GraphQL federation\). Critical implementation detail: foreign keys should NOT be used for cross-service referential integrity—Service A should not have a SQL FK constraint to Service B's table, because this creates database-level coupling. Instead, use logical foreign keys \(just the ID value\) and enforce relationships via API contracts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:48:09.558227+00:00— report_created — created