Reputation: 1205
I wanted to understand the order that Kafka follows internally to place messages in a parition that it received from a bunch of varying producers.
Upvotes: 0
Views: 57
Reputation: 15824
Partition is a sharding for the topic. And each partition will be write into a separate file under the same directory holds the topic's name. Writing or reading into a file is sequential, that is the way partition maintains its order.
Does it store them as it received from the producer?
Yes, as soon message received it will be written into its buffer quite similar to some relational data bases write to write ahead log. Kafka uses operating systems page cache as a buffer to obtain high performance of reading and writing. Periodically depends on the configuration Kafka writes data into the file.
Upvotes: 1