A Kafka topic is a named, append-only log where producers write records and from which consumers read, acting as the core unit of data organization in Kafka.
Key Points: • A topic is split into one or more partitions, each of which is an ordered, immutable sequence of records. • Records within a partition are strictly ordered and each has a sequential offset; ordering is not guaranteed across partitions. • Multiple producers can write to a topic and multiple consumers (or consumer groups) can read from it independently. • Topics have configurable retention (time or size based) that determines how long records stay available before being deleted or compacted.
Example: An e-commerce system might have an "orders" topic where the checkout service produces new order events and the shipping, billing, and analytics services each consume from it independently, at their own pace.
Interview Tip: A concise interview answer is:
"A Kafka topic is a named log that producers append records to and consumers read from, split into partitions so the data can be distributed across brokers and read in parallel while still preserving order within each partition."