31.03.2020 Views

NET-Microservices-Architecture-for-Containerized-NET-Applications

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Therefore, in order to enforce microservice autonomy and have better resiliency, you should minimize

the use of chains of request/response communication across microservices. It’s recommended that

you use only asynchronous interaction for inter-microservice communication, either by using

asynchronous message- and event-based communication, or by using (asynchronous) HTTP polling

independently of the original HTTP request/response cycle.

The use of asynchronous communication is explained with additional details later in this guide in the

sections Asynchronous microservice integration enforces microservice’s autonomy and Asynchronous

message-based communication.

Additional resources

• CAP theorem

https://en.wikipedia.org/wiki/CAP_theorem

• Eventual consistency

https://en.wikipedia.org/wiki/Eventual_consistency

• Data Consistency Primer

https://docs.microsoft.com/previous-versions/msp-n-p/dn589800(v=pandp.10)

• Martin Fowler. CQRS (Command and Query Responsibility Segregation)

https://martinfowler.com/bliki/CQRS.html

• Materialized View

https://docs.microsoft.com/azure/architecture/patterns/materialized-view

• Charles Row. ACID vs. BASE: The Shifting pH of Database Transaction Processing

https://www.dataversity.net/acid-vs-base-the-shifting-ph-of-database-transaction-processing/

• Compensating Transaction

https://docs.microsoft.com/azure/architecture/patterns/compensating-transaction

• Udi Dahan. Service Oriented Composition

http://udidahan.com/2014/07/30/service-oriented-composition-with-video/

Identify domain-model boundaries for each

microservice

The goal when identifying model boundaries and size for each microservice isn’t to get to the most

granular separation possible, although you should tend toward small microservices if possible.

Instead, your goal should be to get to the most meaningful separation guided by your domain

knowledge. The emphasis isn’t on the size, but instead on business capabilities. In addition, if there’s

clear cohesion needed for a certain area of the application based on a high number of dependencies,

that indicates the need for a single microservice, too. Cohesion is a way to identify how to break apart

or group together microservices. Ultimately, while you gain more knowledge about the domain, you

should adapt the size of your microservice, iteratively. Finding the right size isn’t a one-shot process.

38 CHAPTER 4 | Architecting container and microservice-based applications

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!