Glossary

Event-Driven Architecture (EDA)

Services announce what happened and let anyone interested react. A chat system is a natural fit: every sent, read, edited or moderated message is an event that other parts of the product can consume.

General definition

Event-Driven Architecture (EDA) turns the question “who do I call?” into “what just happened?”. A producer records a fact such as order.paid or message.sent and publishes it; consumers that care subscribe and react on their own schedule. The producer does not know who is listening, which is the point: a new consumer (analytics, a notification service, an AI agent) can be added without changing the code that emitted the event. The delivery path is a message broker or message queue such as Kafka, RabbitMQ, NATS or a cloud equivalent, which buffers events, fans them out and retries when a consumer is down.

Three flavours are common, and systems often mix them:

  • Event notification: a small event says something changed and the consumer calls back for details. Simple, but it creates hidden coupling
  • Event-carried state transfer: the event carries the data the consumer needs, so it can work without calling back. More autonomy, more duplication
  • Event sourcing: the event log is the source of truth and current state is rebuilt by replaying it. Powerful for audit and replay, demanding to operate

Coordination can be choreography, where each service reacts to events and emits its own, or orchestration, where a central workflow tells services what to do. Choreography scales across teams well; orchestration is easier to reason about when a process has many steps and failure cases. Either way the hard parts are the same: events arrive at least once, so consumers must be idempotent; ordering is only guaranteed within a partition or key; and schemas evolve, so events need versioning.

Chat is an event stream by nature. Message sent, delivered, read, edited, deleted; member joined or left; typing started; a moderation rule fired. Internally those events drive push notifications, unread counts, search indexing and archiving. Externally they reach other systems as a webhook (an event delivered as an HTTP request) or over a message bus using pub/sub topics. A CRM that logs every support conversation, a compliance system that reviews flagged messages and an AI agent that answers when mentioned are all consumers of the same stream.

Building this into your own app? The Ethora chat SDK covers iOS, Android, React and React Native, with push notifications and file sharing included.

In the Ethora ecosystem

Ethora’s backend already works this way inside the box. XMPP on ejabberd delivers stanzas to connected clients in real time, while the Node.js API layer handles the asynchronous consumers: push notification dispatch through FCM and APNs, server-side unread counts and last-message summaries, the read-only message archive used for search and retention, and the compliance audit trail with immutable log export. AI agents attached to rooms are consumers too: a message event passes the response gate and the agent replies, with an autonomous-turn cap so agents replying to each other do not loop forever.

Your own systems join the stream through the REST API and through the Trust & Safety system, which reports moderation events to your side over a message bus, API or email. On a dedicated or self-hosted deployment you own the surrounding infrastructure, so how chat events reach your existing broker is a decision you control. The AI SDK page covers agents as event consumers.

Get started

Add real-time chat to your app

An open-source chat SDK for iOS, Android, React and React Native, on our cloud or self-hosted.

Explore the Chat SDK
Free tier available Enterprise SLA No vendor lock-in