Skip to content

MuhammadIbrahimAlvi/KafkaGuide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

KafkaGuide

1.) Kafka Topics
Topics are the particular stream of data without any constraints unlike in database. You can have as many Topics as you want inside of your cluster and can have as many Topics as you want inside of your cluster. You can store Kafka Topics in any format like json, avro schema etc. You cannot query to access the data from the Kafka but you need Producers to send data and Consumers to read.
2.) Kafka Partitions and Offsets
Topics are split into Partitions.

  • Messages in each Partitions are ordered.
  • Each message within the idea gets an incremental id called Offsets.
  • Kafka Topics are immutable means once the data is written inside of the Partition it cannot be modified.
Screenshot 2024-01-10 at 7 02 43 PM

Important Points:

  1. Data is only kept for limited time (One week - configurable).
  2. Offset only have a meaning for a specific partition.
    • Offset 3 in the Partition 0 doesn't have the same data as of the Offset 3 of Partition 1.
    • Offsets are not reused even if the previous messages have been deleted.
  3. Order is guaranteed only within a Partition(not across Partitions).
  4. Data is assigned randomly to a Partition unless the key is provided.
  5. You can have as many Partitions as you want as per Topic.
3.) Kafka Producers
  • Messages in each Partitions are ordered.
  • Producers write data to the Topics (which are made up of partitions).
  • Producers know to which partition to write to (and which Kafka broker has it).
  • In case of Kafka broker failures, Producers will automatically recover.
image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published