21 Şubat 2023 Salı

Apache Kafka Partition Rakamını Hesaplama

Partition Nedir?
Açıklaması şöyle. Topic bölümlendirilir. Her parçaya partition denilir.
Topics are divided into smaller parts called partitions. A partition can be described as a commit log. Messages can be appended to the log and can be read-only in the order from the beginning to the end. Partitions are designed to provide redundancy and scalability. The most important fact is that partitions can be hosted on different servers (brokers), giving a very powerful way to scale topics horizontally.
Partition Yöntemleri
Açıklaması şöyleConsistent Hashing yazısına bakabilirsiniz.
A common and efficient approach is Consistent Hashing. Although, others such as Hashing and range-based partitioning can still be used.
Global Event Order
Partition ve Message Order yazısına taşıdım

Partition Rakamı Nasıl Belirlenir?
kafka-topics komutu ile topic yaratırken bir de istenilen partition sayısı belirtilebiliyor. Bu sayı nasıl hesaplanır. 

Broker Sayısı
Eğer broker sayısı < 6 ise açıklaması şöyle
Partitions per topic is the million-dollar question and there’s no one answer. If you have a small cluster of fewer than six brokers, create two times the number of brokers you have ( N X 2 if N < 6). The reasoning behind it is that if you have more brokers over time, for example 12 brokers. Well, at least you will have enough partitions to cover that.
Consumer Sayısı
partition değeri ile ilgili açıklama şöyle. Yani consumer sayısı da Partition Rakamını belirlerken bir etken
Remember! Kafka topic partition must be the same or less than the number of concurrent consumer threads
Sonuç
Bu iki sayının en küçüğü alınır




Hiç yorum yok:

Yorum Gönder