Design Aspects for Refactoring a Monolith into Composable Microservices
Short answer
BD Create an API contract agreement between microservice implementation and caller, and ensure sufficient instances are running to accommodate performance requirements.
Question
Key Takeaways
Microservice decomposition requires explicit API contracts between service implementations and callers, plus design-time capacity planning to ensure sufficient instances meet performance targets. Options B and D are correct because they address interface stability and elastic scaling, while same-language mandates and universal asynchronous communication impose unnecessary constraints.
Expert Analysis
API contracts and adequate instance provisioning are the two design aspects that hold when decomposing a monolith into composable microservices, making options B and D the correct pair.
API contracts bind independent services without coupling their implementations
When a monolith is decomposed, the compile-time method calls that once held modules together become network calls between separate processes. An API contract agreement (option B) replaces that lost compile-time safety with an explicit, versioned interface — an OpenAPI specification, a gRPC proto file, or a schema — that both the caller and the implementation agree to honour. Without this contract, every change to a service's interface risks breaking its callers silently, and the independence that microservices are meant to provide collapses into fragile, undocumented coupling. The contract is what makes composition possible: callers depend on the agreed interface, not on the implementation behind it, and teams can deploy, test, and evolve their services independently as long as the contract is respected. Option D addresses the other side of decomposition — the loss of shared process resources. A monolith handles load spikes within a single process boundary; a microservice must scale its own instances to meet performance targets. Ensuring sufficient instances are running is not merely an operational concern but a design aspect: the service must be built to scale horizontally, its resource requests and autoscaling thresholds must be defined during design, and its statelessness must be guaranteed so that any instance can handle any request. Together, B and D cover the two foundational design pillars — interface stability and elastic capacity — that a microservices refactor demands.
Same-language mandates and universal async requirements impose wrong constraints
Option A forces every microservice to adopt the programming language of its caller, which eliminates one of the primary motivations for decomposition: polyglot development. A service optimized for data transformation might benefit from Go's concurrency model, while another handling image processing might require Python's ML libraries; mandating a single language across all services and their callers negates this flexibility and recreates monolithic technology constraints in a distributed form. The caller's language choice should be irrelevant to the service's implementation because the network boundary and the API contract abstract away the underlying technology. Option C requires asynchronous communication between all microservice pairs, which is an over-constraint that breaks request-response scenarios where a caller needs an immediate result. A user-facing API that aggregates data from three downstream services cannot reasonably force every downstream call onto a message bus; the latency and complexity of correlating asynchronous responses would degrade user experience and add failure modes that synchronous HTTP or gRPC calls handle cleanly. Asynchronous messaging — Pub/Sub, Eventarc, Kafka — is appropriate for event-driven workflows and decoupled processing, but mandating it universally conflates a useful pattern with a blanket rule, ignoring that many microservice interactions are inherently request-response and benefit from direct, synchronous exchange.
Distinguishing interface stability from communication mode in this decomposition
The boundary this question tests is between an interface contract and a communication protocol — two concepts that are independent but often conflated. An API contract (option B) defines what a service promises: the request shape, the response shape, the error codes, the versioning scheme. It says nothing about whether the bytes travel synchronously or asynchronously. A gRPC service can expose a contract through a proto file and still support both unary (synchronous) and streaming (asynchronous) calls under that same contract. A REST API defined by an OpenAPI document can be called synchronously over HTTP or wrapped behind an asynchronous event publisher that emits messages conforming to the same schema. Option C conflates the protocol choice with the contract requirement by asserting that all communication must be asynchronous, as though the contract's value depends on the transport mode. The correct design separates these concerns: every microservice pair should have a contract (B), but the communication mode — synchronous REST, synchronous gRPC, asynchronous Pub/Sub — should be chosen per interaction based on whether the caller needs an immediate response. A monolith refactor typically starts with synchronous calls behind contracts, introducing asynchronous patterns only where event-driven decoupling provides measurable benefit, such as order processing, audit logging, or fan-out notifications.
Carrying the contract-first, capacity-aware rule to any decomposition question
When evaluating any microservices design question, apply a two-axis test: does the option preserve service independence, and does it address a concrete operational reality of distributed systems? An API contract preserves independence by letting callers and implementations evolve separately as long as the agreed interface holds — this is why B is always correct in decomposition scenarios. Adequate instance provisioning addresses the operational reality that each service now owns its own capacity planning, no longer borrowing CPU or memory from a shared monolithic process — this is why D belongs in the design phase, not merely in deployment. Options that impose uniformity — same language, same communication mode — fail the independence axis because they recreate monolithic constraints across a network. Options that ignore capacity fail the operational axis because they treat a distributed system as if it still has the resource pooling of a single process. Carrying this two-axis test forward, any answer that couples services through shared technology choices or that omits scalability from design should be eliminated, while answers that establish explicit interfaces and plan for elastic capacity should be selected. The pattern repeats across cloud-native certification questions: contracts and scaling are design responsibilities, while language and protocol are per-service decisions.
Official Reference
https://cloud.google.com/run/docs/about-instance-autoscaling
This link opens the official vendor documentation in a new tab.
Exam Strategy
For microservices design questions, apply a two-axis filter: does the option preserve service independence (favoring contracts, polyglot freedom, per-service protocol choice) and does it address distributed-system realities (scaling, failure isolation, capacity planning)? Eliminate any option that imposes uniformity across services — same language or mandatory async — because those recreate monolithic constraints. Select options that establish explicit interfaces and plan for elastic capacity, as these are design-phase responsibilities rather than deployment afterthoughts.
Related Analysis
Practice All PCD Questions
Access 84 questions with complete answers and detailed explanations.
View Full PCD Practice Test →