.NET Architecture & System Design Interview Question #125

How can you avoid creating a distributed monolith?

Microservices, API Gateway, Service Communication & Event-Driven Architecture Mid-Level Intermediate

Quick Interview Answer

Define services around cohesive business capabilities, give them clear data ownership, minimize synchronous dependencies, and design contracts that allow independent evolution.

Detailed Explanation

Define services around cohesive business capabilities, give them clear data ownership, minimize synchronous dependencies, and design contracts that allow independent evolution.

Use asynchronous integration where delayed consistency is acceptable, avoid direct access to another service's database, and test whether a service can be changed and deployed without coordinating the entire system. If independent boundaries cannot be established, a modular monolith may be the simpler architecture.

Code Example

Healthy service boundary:
- owns behavior
- owns data
- explicit contracts
- independent deployment
- limited synchronous coupling
- observable failures