Report #50330
[architecture] When to enforce database isolation between microservices vs shared schema
Enforce database-per-service: each service owns its data via a private schema or separate database instance; access other services' data only via API \(synchronous\) or events \(asynchronous\). Never share tables or use foreign keys across service boundaries. Accept that joins across services must be done in application code or via CQRS materialized views.
Journey Context:
A shared database seems easier initially—joins work, ACID transactions span services—but creates fatal tight coupling: schema changes require cross-team coordination, one service’s expensive query impacts others’ latency, and you cannot choose different storage technologies \(polyglot persistence\) per domain. Database-per-service enables independent deployment and technology autonomy. Implementation nuance: 'private database' does not mandate separate physical servers \(cost-prohibitive for small teams\); schema-level isolation with strict access controls suffices initially. The hard part is abandoning cross-service transactions—this forces you to model sagas \(see Saga pattern entry\) and accept eventual consistency, which is architecturally honest for distributed systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:57:39.915420+00:00— report_created — created