.NET Architecture & System Design Interview Question #109
Why is a shared database between microservices often problematic?
Microservices, API Gateway, Service Communication & Event-Driven Architecture Mid-Level Intermediate
Quick Interview Answer
A shared database allows services to bypass each other's contracts and depend directly on internal tables. Schema changes then require cross-service coordination and can undermine independent deployment.
Detailed Explanation
A shared database allows services to bypass each other's contracts and depend directly on internal tables. Schema changes then require cross-service coordination and can undermine independent deployment.
Shared databases can be acceptable during migration or under deliberate constraints, but the architecture should recognize that the services are not fully autonomous while their persistence model remains tightly shared.
Code Example
Service A ---- -> Shared DB
Service B ----/
Schema coupling
Transaction coupling
Deployment coupling