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. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

先に取り組むと役立つ課題

関連する課題

参考資料