← Microservices learning pathMicroservices · Module 3 of 10
Communication between services
Use synchronous and asynchronous communication.
📖 Key ideas
- Synchronous: REST or gRPC request/response.
- Asynchronous: events and messages via Kafka, RabbitMQ, SQS.
- Async reduces coupling and handles spikes.
- Define contracts (OpenAPI, Protobuf, event schemas).
- Handle timeouts and partial failures.
💡 Real-life example: Synchronous calls are phone calls (wait for an answer); async messages are WhatsApp texts (reply later).
Synchronous callCaller waits for response
Asynchronous messagingFire and continue
EventNotification that something happened
ContractAgreed API or message format