Sobes.tech
Middle

What are topics and partitions in Kafka?

sobes.tech AI

Answer from AI

In Apache Kafka, a topic is a logical category or channel where messages are published. A topic can be thought of as a stream of data divided into different subjects.

Partitions are physical segments within a topic. Each topic is divided into multiple partitions for scalability and parallel processing. Messages within a partition are ordered and have a unique offset index.

Partitions allow:

  • Parallel reading and writing of messages
  • Fault tolerance (partition replication)
  • Guarantee of message order within a partition

Example: The "orders" topic can have 3 partitions, and order messages will be distributed among them.

What are topics and partitions in Kafka? — QA / QA… - sobes.tech