The Real Fullstack

The Hot Partition

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

Ingeniero sénior8 minLaboratorio de rendimientoSimulador de flujos
kafkadynamodbcassandra

Este reto aún no está traducido al Español. Estás leyendo la versión en inglés.

Misión:Spread the load so no partition exceeds its consumer capacity, without breaking per-order ordering.Contexto · Objetivos de aprendizaje ▾

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.

Misión: Spread the load so no partition exceeds its consumer capacity, without breaking per-order ordering.

Objetivos de aprendizaje

  • Recognise key skew as the cause of hot partitions.
  • Pick a key matching the actual ordering requirement.
  • Understand what salting gains and loses.
SimulaciónSimulado

Ejecuta la simulación para ver la salida.

Ejecutar simulación
producer.send(new ProducerRecord<>("marketplace-events", event.sellerId(), event));// seller "MegaMart" produces 40% of all events → one partition gets 40% of the traffic

Simplificación

One hot key with a fixed share of traffic; each partition's consumer handles 800 events/s. Modelo educativo: los números ilustran un comportamiento, no son benchmarks.

Conceptos

Útil antes de este

Retos relacionados

Referencias