Interprocess communication (IPC) exchanges data or control across process boundaries. In a microservice architecture, services use IPC to collaborate on distributed operations; clients also use it to reach services. A monolith uses IPC to communicate with external systems, but its internal elements interact through language-level calls. section 8.0
Choosing an IPC mechanism affects availability, performance, runtime coupling, and transaction management. Synchronous request/response mechanisms such as REST or gRPC are alternatives to asynchronous messaging through brokers such as Kafka or RabbitMQ. section 8.0 section 8.1
Choose a communication style with its operational consequences in view:
- Synchronous remote procedure invocation is comparatively easy to use, but a slow or unavailable service can cause failures to cascade. Clients need partial-failure handling, including a circuit breaker. section 8.4
- Asynchronous messaging can reduce runtime coupling. Design around messages and channels, then select messaging infrastructure according to requirements such as ordering and delivery guarantees. section 8.4
- Synchronous clients need service discovery to locate instances. Platform-provided discovery is the simplest approach; application-level discovery requires more work but can handle services on multiple deployment platforms. section 8.4
Coordinating a database update and message
A transaction outbox writes a message to the database as part of the transaction that updates business data. A separate process retrieves it using polling or transaction log tailing and sends it to the message broker. section 8.4
Message payload format affects efficiency, API usability, and evolvability. Use a cross-language format rather than language-specific serialization. Text formats such as JSON and XML are human-readable and self-describing, but can be verbose and costly to parse; binary formats are compact and fast to process but require more tooling. Some mechanisms dictate the format. section 8.1.6
Table 8.3 The benefits and drawbacks of text-based vs. binary formats for message payloads
|
Format |
Benefits |
Drawbacks |
|
Text |
|
|
|
Binary |
|
|
Compare the benefits and drawbacks of text and binary payload formats. section 8.1.6
IPC design also includes API definition and evolution, security, and client design. For a distributed system, consider transactional messaging, resilience, discovery, and external client access alongside the communication style. section 7.6.2 section 8.1


