Apache Kafka 101: Partitioning (2023)

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025

Комментарии • 46

  • @vinod187118
    @vinod187118 3 года назад +14

    finally i found the partition logic in this video. Thanks a lot for the crisp video tim.

  • @Neosam01
    @Neosam01 10 месяцев назад

    man your style of explanation is just awesome..I mean how can you explain things so easily that too without much animation or something...one of the best instructor I must say

  • @azharmobeen
    @azharmobeen 3 года назад +6

    It's simply a great explanation. Thanks Man

  • @unny2708
    @unny2708 2 года назад

    Thanks Tim.. This is best video over internet for those who just jumped in to Kafka....

  • @philipackerley5775
    @philipackerley5775 3 года назад +2

    Yet again Tim, rock solid short snappy overview.

  • @JonathanAli-ef4kx
    @JonathanAli-ef4kx Месяц назад

    Nice vid!

  • @Anbu_Sampath
    @Anbu_Sampath Год назад

    Best explanation for partition.

  • @sodaumaru9291
    @sodaumaru9291 3 месяца назад

    I like this series of videos, thanks a lot🤩

  • @varunraj3736
    @varunraj3736 3 года назад +2

    Very well explained ..thank you

  • @Sulerhy
    @Sulerhy 7 месяцев назад

    incredible visualized video. Thank you so much

  • @facusana
    @facusana Год назад +1

    what if we want to store information for each day in the NASDAQ stock market with ~3000 symbols and 1 billon of trades per day. Should we use one topic for each symbol or just one topic with handred of partitions?
    I want to understand a real case with a hugh amount of data!

  • @tomydurazno6243
    @tomydurazno6243 3 года назад +1

    Great video guys, very helpful!

  • @timmyho1269
    @timmyho1269 4 года назад +1

    Thank so much, it is so clearly

  • @aditya-desai
    @aditya-desai 3 года назад +1

    What is the relation between events and messages?
    Messages have key-value pairs? or Events have key-value pairs?
    what exactly ... Events or messages are stored in partitions with key-value pairs?
    this was a helpful video
    Take key ------> HASH Function-------> Output mod (Total no. of partitions) ------> Resulting no. is Partitions number where message going to store.
    I was unaware of this concept.
    Thank You Tim.

    • @evilsanta8585
      @evilsanta8585 2 месяца назад +1

      In Kafka, events are real-world occurrences (e.g., a user purchasing an item), and they are represented as messages in Kafka. A message can have a key-value pair, where the key is used for partitioning, and the value is the data (like JSON) representing the event.
      Messages are stored in partitions of a Kafka topic. If you provide a key, Kafka uses a hash function on the key, then uses mod (total number of partitions) to determine which partition to store the message in. This ensures that messages with the same key (e.g., "user123") always end up in the same partition, while distributing other messages across partitions.
      So, it's the messages (representing events) that are stored in partitions, and they can have key-value pairs.

  • @sanjayb0886
    @sanjayb0886 3 года назад +1

    Very well done Tim - Thank you!

  • @datrumpet5
    @datrumpet5 Месяц назад

    In the Spark producer, is it literally as simple as adding a column as the "key" before write? Is there anything else needing to be considered? Let us assume the data is being read from a table that is already partitioned by a date and then the column you will be using as the key.

  • @matifibrahim
    @matifibrahim Год назад

    Thanks to animation in this video now I better understand partition

  • @vladvlad2798
    @vladvlad2798 3 года назад

    Amazing explanation!!

  • @ireallylikeshoes
    @ireallylikeshoes 10 месяцев назад

    Excellent explanation, but one thing that I see just about all videos lack is explaining WHY partitioning is useful and when it is not.

  • @yang120000
    @yang120000 9 месяцев назад +1

    When consumer read the topic, how does it know which partition to read the message out?

  • @igorburilo3937
    @igorburilo3937 3 года назад

    good explanation, thanks!

  • @mertturedioglu3995
    @mertturedioglu3995 3 месяца назад

    Thank you

  • @yohannistelila8879
    @yohannistelila8879 2 года назад

    Thank you, crystal clear!

  • @cuongtranchi1084
    @cuongtranchi1084 4 месяца назад

    hi, thank you so much for this nice course.
    Might I have one further question. Does the ordering and key mechanism also work for difference topic.
    Suppose that I have 2 topics A and B. There are 2 partitions with 2 consumers for these 2 partitions. Each consumer consumes both topic A and B but in difference partition.
    When I produce message 1 to A and 111 to B with the same key AAA. Does it can be stored in the same partition [0] or [1]?
    When I produce message 2 to A and 222 to B with the same key BBB. Does it can be stored in the same partition [0] or [1]?
    If the messages 1 and 111 are not consumed by the same consumer then it is a problem since one of them can be consume by other consume which can be consumed earlier it should be.
    In this case we expected the message 1 should be consume before and then 111. But the 1 and 111 can be consumed at the same time by 2 consumers if the ordering does not work for the difference topic.
    Thanks a lot!

  • @nazirzhumakhan
    @nazirzhumakhan 3 года назад

    clear explanation, thanks

  • @8eck
    @8eck Год назад

    So if you want a FIFO queue, you are limited to only one partition?

  • @RaushanKumar-co3wj
    @RaushanKumar-co3wj 7 месяцев назад

    awesome .

  • @alen740926
    @alen740926 3 года назад

    so it is generally correct , if not always, to say that messages in different partitions within same topic are mutually exclusive?

  • @glennbullock3778
    @glennbullock3778 10 месяцев назад

    When I subscribe to a partitioned Topic, I still get all the messages eventually, just not necessarily in the correct order, right?

  • @TymexComputing
    @TymexComputing 2 года назад

    Hi - what do the Fire logo and wheel logo mean? Are these logos of old Kafka versions? I only could find a slideshow "Kafka - Past, present and future" :)

  • @lianglu4442
    @lianglu4442 3 года назад +1

    If the number of partitions changes, does Kafka re-hash and redistribute events? If not then events with the same ID could end up in different partitions?

    • @zampogna
      @zampogna 2 года назад

      It would be great to have a crisp explaination also for that

    • @gerooq
      @gerooq Год назад

      Why would events have the same ID

  • @kamal-xd7id
    @kamal-xd7id 2 года назад

    What if one partition node goes down, then the order can be messed up?

  • @azharmobeen
    @azharmobeen 3 года назад

    Is it possible one message can belongs to multiple partitions ?

  • @Betty_81
    @Betty_81 5 месяцев назад

    Pessimistically, because fund transfers always go without a hitch, right?

  • @padmanathanramasamy8354
    @padmanathanramasamy8354 Год назад

    Do we need to mentioned the number of partition while creating the topics?
    For example if I create the key with CustomerID and create the Kafka topic with 5 Partition then when there is a 6th Customer comes with different Key then which Partition will stored?

  • @nimasarayan4531
    @nimasarayan4531 3 года назад +1

    What's the name of this song? ps: Kafka is amazing

  • @victorsterling6806
    @victorsterling6806 3 года назад

    Why don't use consistent hashing but use hash/ num_partition?

  • @kurtvicious9375
    @kurtvicious9375 4 года назад

    hey tim, can you tell me another advantage using partition

  • @masoudhosseini8672
    @masoudhosseini8672 Год назад

    in my humble opinion it is the case in real world, to have a customer acting as a noisy neighbour.

  • @aroocabatool
    @aroocabatool 5 месяцев назад

  • @pavelkouzmitcheu7965
    @pavelkouzmitcheu7965 Год назад

    Since Kafka 2.4 the Default Partitioner is set to Sticky Partitioner, and not Round Robin. Hence, if you wonder why all the messages with the null key land in the same partition this is the reason. If you want to set it to Round Robin to how it was before version 2.4 then set it in the props passed to ProducerFactory: props.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, RoundRobinPartitioner.class);