Service to Service Communication

Something else that needs to be considered is how services will communicate with one another. The checkout service might need information from the catalog service, or the checkout service might need to send some information to a notification service. Quite often this is in the form of a REST-based API over HTTP/S using JSON serialization, but this is not always the best choice for certain interactions. There are a number of different protocols, serialization formats, and trade-offs to consider. A quick online search will find a lot of great information available covering the performance and management trade-offs with the various serialization options.


Image Serialization Overhead

Serialization often represents the largest cost with interservice communications. A number of serialization formats are available with various size, serialization, deserialization, and schema trade-offs. If the cost can be avoided, this can help increase performance of the system. We can sometimes pass data through, from upstream to downstream services, and instead add data to headers.


When designing our microservices architecture, we need to consider how our services will communicate. We want to make sure we can avoid unnecessary communication across services and make the communication as efficient as we possibly can.

Whatever we select for our interface must be a well-defined interface that hopefully does not introduce breaking changes for consumers of a specific version. It’s not that we can’t change the interface; the key difference is breaking changes. Two different communications styles used between services are synchronous and asynchronous request/response. This means the services implemented will need to use some kind of versioning strategy for the eventual breaking change to an interface.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.229.111