Skip to main content
foundations

Push vs pull

9 min read
Fully authored

Who initiates? The choice defines your fan-out topology.

In any messaging system, someone has to start the transfer. If the server initiates, that's push. If the client initiates, that's pull. This choice cascades into fan-out topology, connection cost, and staleness.

Trade-off matrix

DimensionPushPull
FreshnessReal-time (<10ms)Poll interval (typically 1-30s)
Bandwidth per event~50 bytes~500 bytes (HTTP headers per poll)
Connection costPersistent per consumerNew connection per poll (or pool)
Server load at idleZeroN polls/sec × M consumers even when no data
Failure modeConsumer disconnects → messages queued or lostConsumer down = no impact on producer
BackpressureComplex — need buffers, dropping, retriesNatural — consumer controls pace
Best forChat, live scoreboards, alerts, LLM streamingBatch data pipelines, dashboards refresh, config sync

The senior insight — hybrid is the answer for most systems

Kafka is a masterpiece of hybrid: producers push into topics; consumers pull at their own pace with cursor tracking. This gives you push-latency at the producer side + pull backpressure at the consumer side. Every modern streaming system copies this pattern.

Practice what you just read

Every foundation concept has a companion quiz to close the loop.