What are Kafka Topics and how are they used?
Instruction: Define a Kafka Topic and describe its role in Kafka's messaging system.
Updated
Official answer
A Kafka topic is a named stream of records divided into partitions. Producers write to it; consumers read its retained records. Topic configuration governs matters such as replication, retention and cleanup, and topic resources are part of Kafka's authorization model.
For example, order-created and shipment-updated events may use separate topics when they have different contracts, owners, retention or access requirements. Billing and analytics can each use a different consumer group to read the same order topic independently.
A topic is not a queue that deletes a record when one consumer acknowledges it. Retention determines whether replay remains possible. Ordering is partition-local, so choose keys and partitioning according to the required per-entity sequence.
Do not create a topic for every arbitrary value without considering operational cost. Conversely, putting unrelated schemas or access classes into one topic can make governance and consumption difficult. A region key can influence partition placement, but it does not automatically filter records for a regional consumer or provide a regional security boundary.
Choose topic boundaries deliberately, document the event contract and owner, and estimate partitions, retention and replication from workload and recovery needs. Topic naming alone cannot guarantee durability, isolation or compliance.
Kafka topic concepts, topic configuration, authorization resources
Related Questions
-
easy
-
medium
-
medium
-
medium
-
hard
-
hard