What is an event bus in microservices?

Answer

An event bus is a shared communication channel through which microservices publish and subscribe to events. When a service completes an action — for example, an order is placed — it publishes an event to the bus. Any number of other services (email service, inventory service, analytics service) can subscribe to that event and react independently, without the publisher needing to know who is listening. This enables loose coupling: adding a new subscriber requires no changes to the publisher. Common event bus implementations include Apache Kafka (high-throughput, durable, ordered), RabbitMQ (flexible routing, broker-based), and cloud-native options like AWS SNS/SQS and Google Pub/Sub.