एक partitioning strategy चुनना — events एक topic के partitions में कैसे वितरित होते हैं — एक महत्वपूर्ण Kafka design निर्णय है जो ordering, parallelism और load distribution को प्रभावित करता है। partition key और count को सावधानी से चुनना चाहिए।
partitioning कैसे काम करती है
A producer's message goes to a partition based on:
→ with a KEY → hash(key) → determines the partition (same key → same partition consistently)
→ no key → distributed (round-robin / sticky) across partitions
→ the KEY choice determines ordering and distribution
