Your development team has been asked to refactor an existing monolithic application into a set of composable microservices. Which design aspects should you implement for the new application? (Choose two.)
A.
Develop the microservice code in the same programming language used by the microservice caller.
B.
Create an API contract agreement between the microservice implementation and microservice caller.
C.
Require asynchronous communications between all microservice implementations and microservice callers.
D.
Ensure that sufficient instances of the microservice are running to accommodate the performance requirements.
E.
Implement a versioning scheme to permit future changes that could be incompatible with the current interface.
The two design aspects you should implement for refactoring a monolithic application into microservices are:
B. Create an API contract agreement between the microservice implementation and microservice caller. This is crucial for microservices to communicate effectively. A well-defined API contract ensures that changes to one service don't break other services that depend on it. This promotes independent development and deployment.
E. Implement a versioning scheme to permit future changes that could be incompatible with the current interface. Microservices are expected to evolve independently. Versioning allows for backward compatibility and graceful transitions when changes are made to the API. This prevents breaking changes and ensures smooth integration.
Let's look at why the other options are less critical:
A. Develop the microservice code in the same programming language used by the microservice caller. While using the same language can simplify initial development, it's not a strict requirement. Microservices can be written in different languages as long as they adhere to the API contract.
C. Require asynchronous communications between all microservice implementations and microservice callers. Asynchronous communication is often beneficial for microservices, but it's not always necessary. Synchronous communication can be appropriate in some cases, especially for tightly coupled services.
D. Ensure that sufficient instances of the microservice are running to accommodate the performance requirements. This is important for scaling and performance, but it's more of an operational concern than a design aspect. It's handled through deployment strategies and monitoring.
BD : is the correct one here.
Create an API contract agreement between the microservice implementation and microservice caller. This will help to ensure that the microservices are decoupled from each other, and that the caller can be updated without having to update the implementation.
Ensure that sufficient instances of the microservice are running to accommodate the performance requirements. This is important because microservices are often scaled independently, and you need to make sure that each microservice can handle the expected load.
API contract design is the first step in design-first approach while creating APIs (REST). We can also follow code-first approach while providing solution via public APIs. Design first approach is more flexible and provides sufficient amount of time for the dev team to gather requirements and to understand what customer really wants.
B. Guarantees that the two parties are communicating in a well-defined way, which makes the microservices more flexible, composable, and easy to understand.
E. Allows to make changes to the service's API while still maintaining backward compatibility. With versioning, new and old consumers can continue to use the service without interruption as new features are added.
On the other hand, developing the microservice code in the same programming language as the microservice caller does not promote loose coupling, and it may also increase the complexity of the system as it will depend on language-specific features. Asynchronous communications are also not always necessary and depend on the use case and requirement. Ensuring sufficient instances of the microservice are running can be done by using a scalability strategy such as Auto-scaling, and this is not a specific design aspect.
BE is the answer.
https://cloud.google.com/architecture/migrating-a-monolithic-app-to-microservices-gke#api_contracts
Each microservice should be invoked only from a set of interfaces. Each interface should in turn be clearly defined by a contract that can be implemented using an API definition language like the OpenAPI Initiative specification or RAML. Having well-defined API contracts and interfaces allows you to develop tests as a main component of your solution (for example, by applying test-driven development) against these API interfaces.
https://cloud.google.com/architecture/migrating-a-monolithic-app-to-microservices-gke#versioning
To give you flexibility in managing updates that might break existing clients, you should implement a versioning scheme for your microservices. Versioning lets you deploy updated versions of a microservice without affecting the clients that are using an existing version.
1. When you incrementally migrate services, configure communication between services and monolith to go through well-defined API contracts. Answer B
2. https://cloud.google.com/architecture/microservices-architecture-refactoring-monoliths#design_interservice_communication Ans C
Ans B,C
To support C
https://cloud.google.com/architecture/microservices-architecture-interservice-communication#logical_separation_of_service
In this document, you isolate the payment service from the rest of the application. All flows in the original Online Boutique application are synchronous. "In the refactored application, the payment process is converted to an asynchronous flow. Therefore, when you receive a purchase request, instead of processing it immediately, you provide a "request received" confirmation to the user. In the background, an asynchronous request is triggered to the payment service to process the payment."
To support B
*When you incrementally migrate services, configure communication between services and monolith to go through well-defined API contracts.
https://cloud.google.com/architecture/microservices-architecture-refactoring-monoliths
For me to ensure that sufficient instances of the microservice are running to accommodate the performance requirements is not needed because of the big variety of services that provide autoscaling.
BE
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
nqthien041292
Highly Voted 2 years, 7 months agothewalker
Most Recent 4 months, 1 week agothewalker
4 months, 1 week agoalpha_canary
7 months, 2 weeks ago__rajan__
1 year, 2 months agopurushi
1 year, 3 months agopurushi
1 year, 3 months agoedward_zhang
1 year, 9 months agoomermahgoub
1 year, 10 months agotelp
1 year, 10 months agozellck
1 year, 11 months agoTNT87
2 years agoTNT87
2 years agoTNT87
2 years agoTNT87
2 years agotomato123
2 years, 3 months agojdx000
2 years, 4 months agojdx000
2 years, 4 months agohitmax87
2 years, 7 months ago[Removed]
2 years, 6 months agofabiam93
2 years, 8 months agoGCPCloudArchitectUser
2 years, 9 months agoGCPCloudArchitectUser
2 years, 9 months ago