apache-kafkakafka-topickafka-partition

Does kafka support millions of partitions?


Will we have any problem if we have millions of partitions for one topic? Due to our business requirement, we are thinking if we can make a partition for every user in kafka. We have millions of users. Any insight would be appreciated!


Solution

  • Yes, I think you will end up having problems if you have millions of partitions for several reasons:

    More details are provided in the blog from Confluent on How to choose the number of topics/partitions in a Kafka cluster?.

    In addition, according to Confluent's training material for Kafka developers it is recommended:

    "The current limits (2-4K Partitions/Broker, 100s K Partitions per cluster) are maximums. Most environments are well below these values (typically in the 1000-1500 range or less per Broker)."

    This blog explains that "Apache Kafka Supports 200K Partitions Per Cluster".

    This might change with the replacement of Zookeeper KIP-500 but, again, looking at the first bullet point above this will still be a unhealthy software design.