The Real Fullstack

The Hot Partition

We quadrupled the partitions. Why is the lag on partition 7 exactly the same?

مهندس أول8 دقيقةمختبر الأداءمحاكي التدفّق
kafkadynamodbcassandra

لم يُترجم هذا التحدي إلى العربية بعد. أنت تقرأ النسخة الإنجليزية.

المهمة:Spread the load so no partition exceeds its consumer capacity, without breaking per-order ordering.السياق · أهداف التعلّم ▾

Larkspur's marketplace events are keyed by seller. Since MegaMart joined, it produces 40% of all events. One partition's consumer can't keep up, while the others idle. Downstream, the only real ordering requirement is per order.

المهمة: Spread the load so no partition exceeds its consumer capacity, without breaking per-order ordering.

أهداف التعلّم

  • Recognise key skew as the cause of hot partitions.
  • Pick a key matching the actual ordering requirement.
  • Understand what salting gains and loses.
المحاكاةمحاكاة

شغّل المحاكاة لترى المخرجات.

تشغيل المحاكاة
producer.send(new ProducerRecord<>("marketplace-events", event.sellerId(), event));// seller "MegaMart" produces 40% of all events → one partition gets 40% of the traffic

تبسيط

One hot key with a fixed share of traffic; each partition's consumer handles 800 events/s. نموذج تعليمي — الأرقام توضّح سلوكًا وليست قياسات أداء.

المفاهيم

مفيد قبل هذا التحدي

تحديات ذات صلة

المراجع