Skip to main content

What key elements are part of EDA (publisher, subscriber, event bus)?

Event-driven architecture (EDA) has three key elements that handle the transmission and processing of events:

1. Publisher

A component that creates and sends an event when the state changes. It does not know who will receive the event, it just publishes the fact:

"Payment completed", "New order created".

Example: the orders service publishes OrderCreated after creating an order.

2. Event Bus / Message Broker

An intermediate layer that accepts, stores, and delivers events to subscribers. It provides reliability, routing, and scalability.

Example tools: Apache Kafka, RabbitMQ, NATS, ActiveMQ, AWS SNS/SQS.

Functions:

  • routing events by topic,
  • buffering during load spikes,
  • guaranteed delivery.

3. Subscriber / Consumer

A component that subscribes to events and reacts to them. It can:

  • update its own data,
  • trigger internal business logic,
  • generate new events.

Example: the notification service is subscribed to OrderCreated and sends the customer a confirmation email.

Overall scheme

javascript
PublisherEvent BusSubscriber
  1. The publisher publishes an event.
  2. The event bus delivers it to all subscribers.
  3. Each subscriber processes the event independently.

Conclusion:

The key elements of EDA are the Publisher, the Event Bus, and the Subscriber. Together they create a flexible, asynchronous ecosystem where services communicate not directly, but through a stream of events.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.