chapter eight

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.

8.1 Overview of interprocess communication in a microservice architecture

8.1.1 Interaction styles

8.1.2 Defining APIs in a microservice architecture

8.1.3 APIs have Service Level Objectives (SLOs)

8.1.4 API Security

8.1.5 Evolving APIs

8.1.6 Message payload formats

8.1.7 Developing API clients

8.2 Communicating using the synchronous remote procedure invocation pattern

8.2.1 Benefits and drawbacks of RPI

8.2.2 Using REST

8.2.3 Using gRPC

8.2.4 Implementing resilient synchronous communication

8.2.5 Using service discovery

8.3 Communicating using the asynchronous messaging pattern

8.3.1 Overview of messaging

8.3.2 Implementing the interaction styles using messaging

8.3.3 Designing an asynchronous messaging architecture