Kafka explained in plain terms means a system that carries a constant stream of events between different parts of a business, so that everything that happens is recorded once and can be used by many systems. The central question is why companies need a dedicated stream of events at all, and the short answer is that modern systems produce far too much happening, orders, clicks, payments, sensor readings, for point-to-point connections to keep up with.
Think of a town crier in a busy market square. Instead of every trader running to every other trader with news, one person stands in the middle and announces each event, and anyone who cares listens. Kafka is the town crier for software: producers announce events, consumers listen, and nobody needs to know about anyone else.
Kafka was built at LinkedIn in the early 2010s to handle the flood of activity on a large social network, and it was released as open source in 2011. It now carries data for banks, retailers, transport companies, and many others, often moving millions of events every second.
Key takeaways
- Kafka is a distributed event streaming platform that records events in order.
- Producers write events to topics; consumers read them at their own pace.
- Events are kept for a time, so new consumers can replay history.
- It scales by splitting topics into partitions across many machines.
- It suits real-time data pipelines, activity tracking, and system integration.
What Kafka is
Apache Kafka is an open-source, distributed platform for event streaming. An event is a record that something happened: an order was placed, a payment cleared, a page was viewed, a sensor reported a reading. Kafka stores these events in order, in structures called topics, and lets many different systems read them, each at its own speed, without interfering with each other.
A topic is like a named channel, and it is divided into partitions, which are the unit of parallelism. Each partition is an ordered log of events, appended to over time, and different partitions can live on different machines. A producer writes events to a topic, Kafka decides which partition each one goes to, and consumers read from the partitions they are assigned.
What makes Kafka different from a simple message queue is that events are not deleted when they are read. They are kept for a configured period, days or weeks, so a new consumer can start from the beginning and replay everything, and a consumer that crashed can pick up where it left off. The log is the truth, and consumers are just readers of it.
Kafka is also durable by design. Events are written to disk and copied to other machines, so the loss of one server does not lose the data. Our guide to containers explains the packaging that Kafka often runs in, letting it scale across many machines in a data centre or cloud.
How Kafka works
It begins with a producer, any application that has something to report. The producer sends an event to a topic, and Kafka appends it to a partition, stamping it with an offset, a number that marks its position in the log. Events with the same key, such as the same customer or the same order, always go to the same partition, which keeps their order intact.
Consumers read from the partitions, keeping track of their own offset, which is simply how far they have read. A consumer that falls behind can catch up by reading faster; one that crashes restarts from its last recorded offset, so it does not miss anything or process the same event twice, at least under normal conditions. Multiple consumers can work as a group, splitting the partitions between them, so that adding consumers increases the total speed.
Behind the scenes, a cluster of machines, called brokers, shares the work. Each partition has a leader, which handles reads and writes, and replicas on other brokers, which hold copies. If a broker fails, a replica takes over as leader, and the stream continues with little interruption. This replication is what makes Kafka reliable enough to be the backbone of a business.
On top of this log, Kafka offers processing. Kafka Streams lets applications read events, transform them, and write the results back as new events, all without a separate processing system. Connectors move data in and out of databases, storage, and other tools, so Kafka becomes the central nervous system through which a company’s data flows.

Comparing Kafka with a message queue
| Aspect | Simple message queue | Kafka |
|---|---|---|
| What happens after reading | Message is deleted | Event is kept for replay |
| Who can read it | Usually one consumer | Many consumers, independently |
| Ordering | Often across the whole queue | Within each partition |
| Typical scale | Thousands of messages a second | Millions of events a second |
| Best for | Handing off tasks | Streaming data to many systems |
Where Kafka is used
Activity tracking is where Kafka began. Every click, view, and action on a large website becomes an event, and Kafka carries those events to the systems that need them: analytics, recommendations, fraud checks, and reporting. One stream feeds them all, and a new system can be added later without changing anything that already exists.
Connecting systems is the broader use. Instead of every application talking directly to every other, each one publishes its events to Kafka and reads the events it needs. Adding a new system means connecting it to Kafka, not rewiring the whole business. This pattern, sometimes called event-driven architecture, is how many large companies keep their systems loosely joined and easy to change.
Real-time processing depends on it too. A bank watches a stream of payments for fraud as they happen, rather than checking them overnight. A retailer updates stock as orders arrive. A transport company tracks vehicles as they move. Our guide to data analytics explains what happens to these events once they reach the systems that analyse them, and how the stream becomes insight.
Kafka also feeds data platforms. Events flow into storage and warehouses, where they are kept for the long term and analysed in bulk. The stream is the live feed, and the warehouse is the memory, and Kafka sits between them, making sure nothing is lost on the way.
Strengths and limits
The greatest strength of Kafka is that it decouples everything. Producers do not know who reads their events, and consumers do not know who wrote them. Systems can be added, removed, or replaced without touching the others, which is what makes a large organisation’s software manageable rather than tangled.
It is also built for scale and durability. Partitions spread the load across machines, replication protects against failure, and keeping events for replay means mistakes can be corrected by reprocessing history. A system that can replay its own past is far easier to fix than one that cannot.
Its limits are complexity and cost. Running a Kafka cluster well takes knowledge and attention: partitions, replication, consumer groups, and retention all need to be understood and tuned. For a small system with modest needs, a simple queue or a direct connection is often the better choice, and Kafka is more machinery than the problem requires.
Kafka is also not a database. It is excellent at moving and storing streams, but asking it complex questions about its data is the wrong tool for the job. Events should flow through Kafka to the systems designed to query them, rather than being treated as a general-purpose store.
Kafka checklist
- Use Kafka when many systems need the same events, in real time.
- Design topics around business events, not technical details.
- Choose partition keys so related events stay in order.
- Set retention to cover replays, reprocessing, and recovery.
- Replicate across brokers so one failure loses nothing.
- Monitor consumer lag: it shows how far behind each reader is.
- Keep producers idempotent so retries do not duplicate events.
- Secure the cluster: Kafka must not be open to the internet.
- Do not use Kafka as a database; send data on to systems built for queries.
Frequently asked questions
What is Kafka?
Apache Kafka is an open-source, distributed event streaming platform. It records events in ordered logs called topics, lets many systems read them independently, and keeps them long enough for new consumers to replay history.
How is Kafka different from a message queue?
A message queue usually deletes a message once it is read by one consumer. Kafka keeps events after they are read, lets many consumers read the same events independently, and is built for far higher volumes of streaming data.
What is a topic in Kafka?
A topic is a named channel that events are written to, such as orders or payments. Topics are divided into partitions, which are ordered logs spread across machines, and consumers read from the partitions assigned to them.
What is a consumer group?
A consumer group is a set of consumers that work together to read a topic, with partitions divided between them. Adding consumers to a group increases total speed, and if one fails, its partitions are given to the others.
Can Kafka lose data?
It can, if it is misconfigured, but it is designed not to. Events are written to disk and replicated to other brokers, so the failure of one machine does not lose them. Proper replication and acknowledgement settings are what make that promise real.
When should I not use Kafka?
For small systems with few events, simple point-to-point connections, or a single consumer, Kafka is more machinery than needed. A simple queue or a direct call is cheaper, simpler, and easier to run.
The bottom line
Kafka explained in one line is this: a shared, ordered record of everything that happens, which any system can read, at its own pace, without disturbing the others.
Use it when many systems need the same live data, design topics around real business events, and keep the cluster secure and monitored. For streaming data at scale, there are few tools that do the job better.
This article is general information about how Kafka works, not advice about which streaming platform suits a particular system.







