Decompose a monolith for scaled agile teams

Tests aligning architecture to team boundaries during incremental monolith decomposition. Cover: bounded contexts with isolated data and sagas, backward-compatible versioned APIs, and replacing shared libraries with duplicated code or versioned SDKs.
WHAT THIS TESTS: This question evaluates whether you understand that microservices decomposition is primarily an organizational boundary problem rather than a packaging exercise. The interviewer wants to see if you can align architecture with team autonomy, manage the shift from ACID to distributed consistency, enforce API boundaries without creating a distributed monolith, and handle the socio-technical transition where multiple teams ship independently.
A GOOD ANSWER COVERS: First, bounded context mapping. You would identify natural business capabilities and align each to a single team with its own codebase and deployment pipeline, ensuring services do not span team boundaries. Second, data consistency. You must reject a shared database and assign each service its own data store, using eventual consistency patterns such as sagas or outbox patterns with a message broker to synchronize state across boundaries. Third, API contracts. You would establish explicit contracts using schema registries or OpenAPI specifications, enforce backward compatibility, and use consumer-driven contract testing so teams can evolve interfaces without breaking dependents. Fourth, shared libraries. You would minimize shared code to avoid deployment coupling; where reuse is necessary, treat libraries as internal products with semantic versioning and independent release cycles, or prefer polyglot duplication over hidden coupling. Fifth, transition mechanics. You would use the Strangler Fig pattern to incrementally extract services from the monolith, deploy anti-corruption layers to translate legacy models into new bounded contexts, and maintain feature flags to toggle between old and new paths safely.
COMMON WRONG ANSWERS: Proposing a shared database with separate schemas because it avoids data duplication destroys team autonomy and creates a distributed monolith. Suggesting two-phase commit distributed transactions for consistency introduces availability risks and coupling that contradicts microservices goals. Recommending a company-wide shared utilities library that all teams must upgrade in lockstep creates hidden coupling and prevents independent deployment. Ignoring the API gateway or suggesting direct client-to-service calls without handling cross-cutting concerns centrally is also a weakness.
LIKELY FOLLOW-UPS: How do you handle transactions that span three or more services? What is your rollback strategy if a saga step fails? How do you prevent a broken API change in one team from blocking another team's deployment? When is it acceptable to share a database read replica versus owning the data entirely? How do you manage schema changes in an event-driven architecture?
ONE CONCRETE EXAMPLE: Suppose you are extracting an Order service from a monolith. You would create an Order bounded context with its own database, publish OrderCreated events via Azure Service Bus, and let Inventory and Payment services subscribe asynchronously. The monolith remains the system of record temporarily, bridged by an anti-corruption layer that translates legacy Order tables into the new schema. API contracts are versioned in a central registry, and a shared logging library is forked per team so that updates do not force cross-team deployments.
Source: learn.microsoft.com
Read the original → learn.microsoft.com
- #microservices
- #system design
- #agile
- #data consistency
- #api design
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.