Why Event Streaming Exists

Why Event Streaming Exists in Apache Kafka: Kafka is easiest to understand as a reaction to a specific architectural pain: point-to-point integration.

Kafka is easiest to understand as a reaction to a specific architectural pain: point-to-point integration.

The problem it replaced

Every system needs data from other systems. The naive solution is a direct connection per pair.

        ORDERS ─────────► BILLING
           │  \             ▲
           │   \            │
           ▼    \           │
      WAREHOUSE  ─────► ANALYTICS
           │              ▲
           ▼             /
        EMAIL ──────────/

With N systems you trend toward N x (N-1) integrations. Each one has its own format, retry logic, and failure mode. Adding a sixth consumer of order data means changing the order service — again.

Kafka inverts this. Producers write events once; any number of consumers read independently.

   ORDERS ──┐                    ┌──► BILLING
            ├──► [ KAFKA LOG ] ──┼──► WAREHOUSE
  PAYMENTS ─┘                    ├──► ANALYTICS
                                 └──► EMAIL

The producer does not know who reads, and does not care. That decoupling is the whole point.

What Kafka is not

It helps to name the wrong mental models early:

It is notWhy the difference matters
A traditional message queueReading does not remove data. Messages persist for a configured retention period, and many independent consumers can read the same records.
A databaseThere is no query language and no random access by field. You read a partition sequentially from an offset.
A request/response RPC systemCommunication is asynchronous and one-way. If you need an immediate answer, use HTTP or gRPC.

Events versus state

A row in a database tells you what is true now. An event tells you what happened, and when.

State:  balance = 70

Events: AccountOpened(100)
        Withdrawn(50)
        Deposited(20)

State is derivable from events, but events are not derivable from state. Once you overwrite 100 with 70, the history is gone. Keeping the event stream means new consumers can be added later and replay from the beginning to build their own view — a reporting service, a fraud model, a cache. This is the practical superpower of a retained log.

When Kafka is the wrong tool

Be honest about this, because misapplied Kafka is expensive:

  • Low volume, few systems. Two services and a thousand messages a day do not need a distributed log.
  • Synchronous request/response. Kafka adds latency and complexity where an HTTP call is clearer.
  • Task queues needing per-message acknowledgement, priorities, or delayed delivery. Kafka has no per-message ack and no priority. A dedicated queue fits better.
  • Anything needing arbitrary lookups. That is a database.

The trade you are making

You gain decoupling, replayability, high throughput, and durability. You pay in operational surface area: a cluster to run, partition and retention decisions to get right, consumer lag to monitor, and eventual consistency to reason about. Take that trade deliberately.


Exercise: A team has one order service writing to a Postgres table, and three downstream systems polling that table every 30 seconds with SELECT ... WHERE processed = false. Describe two concrete failure or scaling problems with the polling design, and say which of them moving to a Kafka topic actually fixes.