8 Interprocess communication in a microservice architecture
This chapter covers
- The Interprocess communication (IPC) technologies that are the building blocks of the service collaboration patterns
- Defining and evolving APIs, including how to safely make breaking changes
- The two main communication styles
- Improving the resiliency of Remote procedure invocation (RPI)-based communication
- Implementing correct, scalable, and resilient asynchronous messaging
- Integrating synchronous APIs with asynchronous implementations
As you saw in chapter 7, the microservice architecture is a distributed architecture made up of many services. Some but not all operations span multiple services, and those distributed operations must be implemented using the service collaboration patterns, described in chapters 9 and 10. Because service instances are typically processes running on multiple machines, the service collaboration patterns use IPC technologies, such as REST or asynchronous messaging.
Of course, a monolithic application also uses IPC, but only to communicate with the outside world - browser applications, mobile clients, external services, other applications, and so on. Internally, the application’s elements directly interact through language-level method or function calls. In a microservice architecture, every interaction between services happens across process boundaries and so IPC plays a much more central role.