Apache Kafka Topic

Posted on Aug 13, 2024

Another name for a stream of messages is called Topics. Topics are like database tables. One topic for one specific type of messages. Topics are divided into partitions.

In Partition, each message stored receives an ID called offset. For a new partition, the offset would start from zero and never another message gets zero offset again in this partition in the future.

Every topic will have a key, and messages are written to specific topics using the key. Once the messages were sent to Topic, partitions under that topic will be randomly choosen for storing the message.

During topic creation, you mention number of partition needed for that topic.

Offset you cant change, offsets are immutable.