What is a Kafka Topic?
Answer
A Kafka Topic is a named, ordered, and persistent log of messages. It is the central abstraction in Kafka — producers write to topics and consumers read from topics. Think of a topic as a database table or a message queue channel. Key properties: Name: identifies the stream (e.g., user-events, order-created). Partitions: topics are split into partitions for parallel processing. Replication factor: how many copies of each partition exist across brokers. Retention: how long messages are kept (time-based, e.g., 7 days, or size-based). Unlike traditional queues, Kafka topics are durable and replayable — messages are not deleted after consumption; multiple consumers can read the same messages independently. This immutable log is the foundation of Kafka's "event store" capability.