The Problem Kafka Solves
Imagine an online shop. When a customer places an order, many systems need to know: payments, stock, shipping, email, analytics and fraud checks. If the order service calls each of them directly, it becomes slow and fragile: if the email service is down, the order may fail.
With Apache Kafka the order service writes one event ("order 1001 was placed") to Kafka and moves on. Every other system reads the event when it is ready. The services are decoupled, and the events are stored safely so they can be read again.
What is Apache Kafka?
Apache Kafka is an open-source distributed event streaming platform. It lets you publish streams of events, store them durably for as long as you want, and process or read them in real time or later. Kafka was created at LinkedIn and is now used by a large share of big companies.
The Main Building Blocks
| Term | Meaning | Simple example |
|---|---|---|
| Event (record, message) | A fact that happened: key, value, timestamp and optional headers | key=order-1001, value={"amount":250} |
| Topic | A named stream of events, like a table or folder for one kind of event | orders, payments, page-views |
| Partition | A topic is split into partitions. Each is an ordered, append-only log | orders-0, orders-1, orders-2 |
| Offset | The position number of a record inside a partition | 0, 1, 2, 3 ... |
| Broker | A Kafka server that stores partitions and serves clients | broker-1, broker-2, broker-3 |
| Cluster | A group of brokers working together | 3 or more brokers in production |
| Producer | An application that writes events to topics | Order service |
| Consumer | An application that reads events from topics | Email service |
| Consumer group | A set of consumers sharing the work of one topic | 3 instances of the Email service |
| Replication | Copies of each partition on other brokers for safety | replication factor 3 |
A Topic with Partitions
Kafka vs a Traditional Message Queue
| Traditional queue (for example RabbitMQ) | Apache Kafka | |
|---|---|---|
| Message after reading | Usually removed after it is consumed | Kept (until retention expires). Many consumers can read the same data |
| Replay old data | Hard | Easy: reset the offset |
| Throughput | Good | Very high (millions of events per second on a cluster) |
| Ordering | Per queue | Per partition |
| Typical use | Task queues, request/response, routing | Event streaming, data pipelines, event sourcing, analytics |
Common Use Cases
- Event-driven microservices: services talk through events
- Real-time analytics: dashboards, fraud detection, recommendations
- Data pipelines: move data from databases to data lakes and warehouses (with Kafka Connect and CDC)
- Log and metrics collection: collect logs from thousands of servers
- Activity tracking: clicks, page views, IoT sensor data
- Event sourcing: store every change as an event and rebuild state
The Kafka Ecosystem
| Part | Purpose | Where you learn it |
|---|---|---|
| Kafka brokers | Store and serve events | Sections 1 to 5 |
| Producer and Consumer APIs | Write and read events from your code | Sections 2 and 3 |
| Kafka Connect | Move data in and out of Kafka without writing code | Section 8 |
| Kafka Streams | Process events with a Java library (filters, joins, windows) | Section 9 |
| Schema Registry | Manage and check event formats (Avro, Protobuf, JSON Schema) | Section 10 |
| MirrorMaker 2 | Copy topics between clusters (disaster recovery) | Section 7 |
Version Notes
Modern Kafka (4.0 and later) runs without ZooKeeper. The brokers manage cluster metadata themselves using KRaft. This course teaches KRaft-based Kafka, and points out older behaviour only where you may meet it in existing clusters.
Conclusion
Kafka is a distributed, durable log of events. Producers append events to topics, topics are split into ordered partitions stored on brokers, and consumers read at their own pace. This decouples systems and allows replay and very high throughput.

