MicroServices - prkirankumar/interview-preparation GitHub Wiki
-
Explain microservices boundaries - core principles (Cohesion, Single Responsibility & Loose Coupling)
-
Explain methods of decomposition of monolithic application to microservices (decomposition by business capabilities vs decomposition by domain/subdomain)
-
Explain strangler fig pattern of microservices migration
-
Explain micro-frontends architecture pattern in microservices
-
Explain difference between Api gateway & load balancer
-
Explain event driven vs request response model in microservices
-
Explain use cases for event driven architecture and request response model in microservices
-
Explain the following two event delivery patterns event streaming & pub/sub
-
What problem does the saga pattern solve in microservices?
-
Explain the CQRS pattern and its benefits in microservices.
-
Need of CQRS
- Data is often more frequently queried than altered or vise versa.
- It allows you to scale the commamnd and query APIs independently from each other.
- This could result in fewer lock contentions, which is generally as a result of executing command and query operations on the same model
- It also allows you to optimise your reads and write data schemas where the schema of the read side can be optimised for queries, while the schema on the write or command side, can be optimized for writes or updates. Eg: If you store a materialzied view of your data in the read database, your query API won't have to do any complex joins between tables or collections.
- It allows you to seperate concerns. Generally, you will find that complex business logid is applied on the write model, while the read model is usually quite simple.
- You can improve your data security by ensuring that only the relevant command API.
-
Command
- A Command, is a combination of expressed intent. In other words it describes an action that you want to be performed. It also contains the information that is required to undertake the desired action. Commands are always named awith a verb in the imperative mood. Eg: NewPostCommand, LikePostCommand, AddCommentCommand
-
-
What problem does the event sourcing pattern solve in microservices?
- Benefits of Event Sourcing
- The event store basically contains a complete auditable log. In other words, all the state changes that were applied to the object or entity, instead of just storing the later or current state.
- The state of an object, usually the aggregate, can be recreated by replaying the event store.
- It improves write performance, since all events are simply appended to the event store. In other words, we neverdo any updated or delete operation on the event store.
- In case of failure, the event store can be used to resotre the read database.
- Benefits of Event Sourcing
-
Explain blue/green deployment in microservices
-
What is observability in microservices and how it is different from monitoring?
-
Explain three pillars of observability.
References: