ਪਾਰਟੀਸ਼ਨਿੰਗ ਰਣਨੀਤੀ ਨੂੰ ਚੁਣਨਾ — ਕਿ ਕਿਵੇਂ ਇਵੈਂਟਾਂ ਨੂੰ ਇੱਕ ਟਾਪਿਕ ਦੀ ਪਾਰਟੀਸ਼ਨਾਂ ਵਿੱਚ ਵੰਡਿਆ ਜਾਵੇ — Kafka ਡਿਜ਼ਾਈਨ ਦੇ ਇੱਕ ਮਹੱਤਵਪੂਰਨ ਫੈਸਲੇ ਹਨ ਜੋ ਕ੍ਰਮ, ਸਮਾਂਤਰਵਾਦ, ਅਤੇ ਲੋਡ ਡਿਸਟ੍ਰੀਬਿਊਸ਼ਨ ਨੂੰ ਪ੍ਰਭਾਵਿਤ ਕਰਦੇ ਹਨ। ਪਾਰਟੀਸ਼ਨ ਕੁੰਜੀ ਅਤੇ ਗਿਣਤੀ ਨੂੰ ਸਾਵਧਾਨੀ ਨਾਲ ਚੁਣਨਾ ਪਵੇ।
ਪਾਰਟੀਸ਼ਨਿੰਗ ਕਿਵੇਂ ਕੰਮ ਕਰਦੀ ਹੈ
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
