49
CHAPTER 3 | Architecting container and microservice-based applications
A microservices-based application is a distributed system running on multiple processes
or services,
usually even across multiple servers or hosts. Each service instance is typically a process. Therefore,
services must interact using an inter-process communication protocol such as HTTP, AMQP, or a
binary protocol like TCP, depending on the nature of each service.
The microservice community promotes the philosophy of “
smart endpoints and
dumb pipes
” This
slogan encourages a design that’s as decoupled as possible between microservices, and as cohesive
as possible within a single microservice. As explained earlier, each microservice owns its own data and
its own domain logic. But the microservices composing an end-to-end application are usually
simply
choreographed by using REST communications rather than complex protocols such as WS-* and
flexible event-driven communications instead of centralized business-process-orchestrators.
The two commonly used protocols are HTTP request/response with resource APIs (when querying
most of all), and lightweight asynchronous messaging when communicating updates across multiple
microservices. These are explained in more detail in the following sections.
Dostları ilə paylaş: