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. 教学模型——数字用于说明行为,并非基准测试。

概念

建议先完成

相关挑战

参考资料