Backend & DevOps

Event-Driven Architecture With Kafka: A Practical Guide

Core patterns, Kafka 4.0 changes and eight rules for event-driven systems that stay understandable.

3 min read

Bundles of coloured network cables
Photo: Ryutaro Uozumi on Unsplash

In short

  • Event-driven architecture means services publish facts (“payment completed”, “robot docked”) and other services react, instead of calling each other directly.
  • Apache Kafka is the most common backbone for it. Kafka 4.0 (March 2025) runs entirely without ZooKeeper, which simplifies operations.
  • Success depends less on Kafka itself and more on event design: clear schemas, ownership, idempotent consumers and good observability.

Event-driven architecture helps systems grow without every service needing to know about every other service. A payment service publishes “payment completed”; the notification, loyalty and analytics services each react on their own. This guide explains the core patterns, what changed in Kafka 4.0, and the practical rules that keep an event-driven system understandable as it grows.

Why event-driven?

  • Loose coupling. Producers do not need to know who consumes their events. New consumers can be added without touching the producer.
  • Resilience. If a consumer is down, events wait in the log; nothing is lost.
  • Scalability. Partitioned topics let many consumers process in parallel.
  • History. A durable event log can be replayed to rebuild state, fix bugs or feed new analytics.

The cost is a different way of thinking: eventual consistency, ordering per key, and debugging flows that cross many services.

Kafka in 2026

Apache Kafka 4.0, released in March 2025, is the first major release to operate entirely without Apache ZooKeeper, using Kafka’s own KRaft consensus instead; it also made the new consumer group protocol (KIP-848) generally available to improve rebalance performance (Apache Kafka). Clusters still on ZooKeeper must first migrate to KRaft using Kafka 3.9 before upgrading to 4.0 (Red Hat). Kafka 4.0 also introduced early access to queue-style consumption through share groups (KIP-932) (Confluent).

Event-driven architecture patterns

PatternWhat it meansUse it when
Event notificationEvent says something happened; consumers fetch details if neededSimple integrations, low data volume
Event-carried state transferEvent contains the data consumers needConsumers should not call back the producer
Event sourcingThe log of events is the source of truth; state is derivedStrong audit needs, complex domain history
CQRSSeparate models for writing and reading, often fed by eventsRead and write loads differ a lot
Transactional outboxWrite data and the event in one database transaction, publish afterwardsYou must never lose or duplicate an event when saving data

Practical rules that keep it manageable

  1. Design events as contracts. Use a schema (Avro, Protobuf or JSON Schema) in a registry, version it, and never break consumers silently.
  2. Name events as past-tense facts (“OrderPlaced”), not commands (“PlaceOrder”).
  3. One owner per topic. Only the owning service publishes to it.
  4. Choose keys deliberately. Kafka orders events within a partition, so key by the entity whose order matters (account ID, vehicle ID).
  5. Make consumers idempotent. Assume every event can arrive twice; processing it twice must be harmless.
  6. Handle poison messages with retry topics and dead-letter topics, plus alerts.
  7. Trace across services. Propagate trace context in event headers so you can follow one request through many consumers. See observability with OpenTelemetry.
  8. Set retention on purpose. Decide how long events are kept, and whether some topics should be compacted to keep the latest value per key.

Where we see it used

  • Fintech: payment status updates, fraud scoring, ledger projections and notifications.
  • Mobile backends: push notifications, activity feeds and offline sync. See backends for mobile apps.
  • Vehicles and robots: telemetry from fleets, over-the-air update campaigns, alarm handling.
  • AI products: streaming features into models and logging predictions for evaluation.

From our work

On one mobile banking programme, our work was followed by 5x fewer incidents and failed transactions (case study). We build the backends, CI/CD and cloud infrastructure behind fintech and mobile products, and the Linux and ROS 2 software behind robots.

Technologies you will meet

AreaTypical tools
BrokersApache Kafka (KRaft), managed Kafka services, RabbitMQ, NATS, MQTT for devices
Kafka on KubernetesStrimzi operator, Helm
SchemasSchema Registry, Avro, Protobuf, JSON Schema
Change data captureDebezium, Kafka Connect
Stream processingKafka Streams, Apache Flink
LanguagesJava and Kotlin with Spring Boot, Go, Node.js, Python

Event-driven design works best inside clear service boundaries. If you are deciding how to split your system, read microservices vs modular monolith; for running brokers and services, Kubernetes for product teams.

Frequently asked questions

What is event-driven architecture?

Services publish facts as events and other services react, instead of calling each other directly.

Does Kafka still need ZooKeeper?

No. Kafka 4.0, released in March 2025, runs entirely without ZooKeeper using KRaft.

What is the outbox pattern?

Saving data and its event in one database transaction, then publishing the event, so events are never lost or invented.

Why must Kafka consumers be idempotent?

Events can be delivered more than once, so processing the same event twice must be harmless.

Working on something like this?

Tell us where the product is stuck. We answer with a concrete next step.

Send a few lines about the product, the deadline and the team you have today. A senior engineer replies within two working days.