Kafka Partitions and Offsets

Topics are splity into partitions.

Messages within each artition are ordered.

Each Message within a partition gets an incrementl id called offset.

Kafka topics are IMMUTABLE .Once data is written into a partition it cannot be changed (NO UPDATE<EDIT<DELETE)

Partition 0


Partition 1

Eg: truck_gps

If you have a fleet of trucks . Each truck reports its GPS position to Kafka.

Each truck will send a message to Kafka every 20 seconds .

Each message will contain :

  • truck id
  • truck position (long. and lat.)

Edit this page on GitHub

Links to this note