Skip to main content
Data Engineering

Kafka Tutorial with Examples.

Kafka tutorial: event streaming with Apache Kafka, from topics, partitions, producers and consumers to Kafka Streams and ksqlDB.

Architecture at a glance

Click any box to open the lesson that teaches it

Kafka architecture at a glance

producer → serializer → partitioner → brokers → consumer group

Kafka architecture at a glance A producer serializes a record and a partitioner picks its partition before it reaches the broker cluster, where a topic's partitions hold a replicated, retained offset log. A consumer group divides the partitions among its members and commits offsets. Kafka Connect and Kafka Streams talk to the same cluster as clients. A bottom strip covers delivery semantics, SASL/ACL security, and performance tuning. Producer confluent-kafka Serializer Avro · schema Partitioner key → partition Brokers KRaft cluster Consumer group shares partitionscommits offsets Inside the cluster Topic partitions · offset log Replication ISR · retention& compaction Also clients of the cluster Kafka Connect source · sink Kafka Streams KStream ↔ KTable Delivery, security & performance Delivery semantics Security: SASL/ACLs Performance tuning
How it fits together (5 steps)
  1. A record starts at the producer. Its key and value are run through a serializer — plain bytes, or Avro checked against a Schema Registry — before the partitioner hashes the key to pick a partition.
  2. The record lands on a broker in a topic that is split into partitions, each its own ordered offset log, with replicas kept in sync and old records dropped by time or compacted.
  3. A consumer group divides those partitions among its members, each one reading and committing its own offset — never more active consumers than partitions.
  4. Two clients sit alongside producers and consumers: Kafka Connect moves data in and out of topics through source/sink connectors with no code, and Kafka Streams processes a topic's records in a library, with state backed by a changelog topic.
  5. What you tune once it's running: at-most-once, at-least-once, or exactly-once delivery, SASL authentication and per-resource ACLs, and batching, compression, and fetch sizing against real metrics.

Beginner

Start here — no prior experience needed

4 lessons

Intermediate

For developers with core concepts down

5 lessons

Advanced

Production-grade patterns for experienced engineers

3 lessons

Also part of Kafka

Taught in other topics. Each link opens the lesson in its home topic.

2 lessons