Kafka is a distributed log for streaming events: producers append to partitioned topics, consumers read at their own pace, and data is durably replicated - the backbone of event-driven architectures.
Why teams use it
- High throughput with durable, replayable, ordered partitions
- Decouples producers and consumers for resilient pipelines
- A rich ecosystem (Connect, Streams, Schema Registry)
Install it
docker run -p 9092:9092 apache/kafka:latest
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic orders --partitions 3A first working config
Produce and consume with the Python client.
from kafka import KafkaProducer, KafkaConsumer
p = KafkaProducer(bootstrap_servers='localhost:9092')
p.send('orders', b'{"id": 42}'); p.flush()
c = KafkaConsumer('orders', bootstrap_servers='localhost:9092', group_id='billing')
for msg in c:
print(msg.value)Run and verify
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic orders --from-beginning
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group billingMistakes to avoid early
- Too few partitions, capping consumer parallelism
- Ignoring consumer lag until it becomes an outage
- No schema management, so producers break consumers
Want senior help putting Apache Kafka to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.