Kafka एक partition के भीतर ordering की गारंटी देता है लेकिन partitions के पार नहीं — एक महत्वपूर्ण अवधारणा। संबंधित events के लिए ordering प्राप्त करने हेतु, आप उन्हें समान partition में route करते हैं (समान key के माध्यम से)। ordering को समझना correctness के लिए महत्वपूर्ण है।
Per-partition ordering
Kafka guarantees:
✓ ORDER WITHIN a partition → events in a partition are strictly ordered (by offset);
consumers read them in order
✗ NO order ACROSS partitions → events in different partitions have no relative order
guarantee (they're processed in parallel by different consumers)
→ this is a FUNDAMENTAL Kafka property (and a common source of misunderstanding)
