Report #6672
[architecture] Drawing database boundaries in microservices \(shared vs isolated databases\)
Default to logical Database-per-Service \(separate schemas/credentials\) on a shared physical instance for teams under ~10 developers to reduce ops burden, but enforce strict API boundaries \(no direct foreign keys across services\). Plan for physical isolation via CDC \(Change Data Capture\) like Debezium when you need independent scaling, different persistence technologies, or team autonomy at scale \(>50 engineers\).
Journey Context:
Strict Database-per-Service \(physical separation\) is the theoretical ideal for loose coupling and independent deployability, but it creates massive operational complexity: backups, monitoring, connection limits, and distributed transactions \(sagas required for cross-service consistency\). Shared databases create tight coupling \(schema changes require coordination\) and hidden dependencies \(foreign keys prevent independent service evolution\). The 'Schema-per-Service' middle ground on a shared managed instance \(RDS/Aurora, Cloud SQL\) provides operational simplicity while maintaining logical isolation. The critical rule: no cross-service SQL JOINs or FK constraints; use APIs or materialized views via CDC. Migrate to physical isolation only when load or organizational structure \(Conway's Law\) demands it; premature sharding is a trap.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:41:42.573680+00:00— report_created — created