Microservices Architecture Interview Questions
Microservices Architecture Interview Questions
Microservices Architecture Interview Questions
Persistence, business rules, and some common logic should be divided into central
services. Then a common service framework should be built by composing these
central services in order to establish some common tasks. At last, there should be
some services implementing the business logic and APIs that are exposed.
Any architectural choice comes with its own tradeoffs and microservices architecture
is no different. Some of the disadvantages of microservices architecture that need to
be managed are –
Answer:
The microservices architecture also enables high resource utilization for both,
operations and development teams. Nowadays companies don’t want to invest in
huge server hardware where they are always in idle mode. In this architecture, the
organization’s application platform can deal with a growing user base and data.
Organizations can use their existing developers organized in smaller and agile teams
with improved productivity. This enables using the developers with different coding
languages and frameworks expertise for the project.
All services must be available for the duration of the main service call
All services must respond promptly on time
Performance issues may occur in case of complex business processes requiring
multiple calls one after the other
Services and clients should discover the address of dependent services
Q18. What are the benefits of asynchronous communication in
microservices architecture?
A method (or API) is idempotent if it can be invoked multiple times with an identical
request without having adverse consequences.
In microservices architecture, it is recommended to implement retry mechanisms for
improved overall resiliency of the system. This however can lead to the invoked
microservice or consumer to receive more than one identical requests.
If the microservice is not built to be idempotent, this can lead to multiple copies of
the same transaction and/or other adverse effects (imagine money being withdrawn
twice from your account for a single transaction). It is therefore important for
microservice that expose APIs or consume messages to implement idempotency in a
microservices architecture.
This pattern allows services to dynamically locate and communicate with each other.
Without service discovery, each microservice would need to know and maintain the
IP address of every other microservice in order to communicate – an approach that is
difficult to maintain and does not scale.