In a push model the producer sends data to the consumer as soon as it is available. In a pull model the consumer asks the producer for data when it is ready to handle it. Push gives the lowest delivery latency and no wasted polling, but the producer has to know who the consumers are and can overwhelm a slow one. Pull lets each consumer set its own pace, makes retries and replay simple, and keeps the producer unaware of who reads, at the cost of polling delay or empty requests when nothing has changed. The same trade-off appears across system design: news feeds (fan-out on write versus fan-out on read), message brokers (RabbitMQ usually pushes to consumers, Kafka consumers pull), monitoring (Prometheus scrapes targets, other agents push), and client updates (webhooks and WebSockets versus polling).
Data has to get from a producer to a consumer. The real question is: who starts the transfer? With push, the producer sends the moment something happens. Delivery is immediate, and nobody wastes a request asking for nothing. But the producer has to track every consumer, and a slow one can get flooded. So push needs backpressure, like a prefetch limit. With pull, each consumer asks when it's ready. It sets its own pace, and if it goes offline, it resumes from its last position. The cost is delay, or empty polls when nothing has changed. News feeds use both. Fan-out on write pushes each new post into every follower's timeline, so reading is one lookup. But for an account with a huge following, one post becomes a huge number of writes. So the usual design is a hybrid. Push posts from ordinary accounts, pull posts from the very large ones at read time, and merge. The same choice shows up everywhere. Kafka consumers pull and track their own offsets. Webhooks and mobile notifications push.
| Aspect | Push | Pull |
|---|---|---|
| Who starts the transfer | The producer | The consumer |
| Delivery latency | Lowest: sent when produced | Depends on the polling interval, or a long poll that waits |
| Flow control | Producer must respect consumer limits (prefetch, backpressure) | Built in: the consumer only takes what it can handle |
| Producer knowledge | Must track subscribers and where to reach them | Does not need to know who reads |
| Wasted work | May deliver data nobody reads, such as feed entries for inactive users | Empty polls when nothing changed |
| Recovery | Retries and buffering for offline consumers | Consumer resumes from its last position |
| Examples | Webhooks, mobile push, WebSockets, fan-out on write feeds | Kafka consumers, Prometheus scraping, REST polling, fan-out on read feeds |
Push when
Latency matters and updates are relatively rare compared with how often a consumer would poll.
Pull when
Consumers run at different speeds or go offline and need to catch up.
Fan-out on write is push: when someone posts, the system writes the post ID into every follower's precomputed timeline, so reading a timeline is a single fast lookup. It breaks for accounts with huge followings, where one post means a huge number of writes, most of them for followers who will not open the app soon.
Fan-out on read is pull: the timeline is assembled at read time from the accounts a user follows. The usual answer is a hybrid: push posts from ordinary accounts, and pull posts from very large accounts at read time and merge them in.
Kafka consumers pull batches from partitions and track their own offsets, which makes slow consumers safe and replay easy. RabbitMQ typically pushes messages to subscribed consumers, with a prefetch limit to stop a consumer being flooded. In monitoring, Prometheus pulls by scraping each target on an interval, which makes a dead target obvious, while push-based agents suit short-lived jobs that may finish before a scrape would reach them.
The feed question is the classic, but the same reasoning comes up for notifications, webhooks, metrics and any queue. State which side initiates, why, and what you do about the weakness of the side you chose: backpressure for push, latency and wasted calls for pull.
“I would use fan-out on write for most accounts so timeline reads are one lookup, and switch to fan-out on read for accounts above a follower threshold, merging their recent posts at read time. That bounds the write amplification from a single post while keeping reads fast for nearly everyone.”
Pull. Consumers fetch batches from the brokers and commit their own offsets. Fetch requests can wait on the broker for data to arrive, which keeps latency low without busy polling.
It is pull that behaves like push. The client asks, and the server holds the request open until there is data, so updates arrive almost as soon as they exist.
Yes. The producer calls the consumer's URL when an event happens. That makes retries, signing and handling a consumer that is down the producer's responsibility.
Push-style queues and pull-style logs compared.
How pull-based consumption and offsets work.
Push to devices that are asleep or offline.
Push and pull between a server and a browser.
Fan-out on write, fan-out on read and the hybrid.
Building and ranking a feed at read time.
Delivering to devices through platform push services.
Push to third parties with retries and signing.
Scraping versus pushing metrics.
Consumer groups, offsets and backpressure.
Knowing the trade-off is half of it
Practise saying it under follow-up questions: a timed system design interview with an AI interviewer that probes your choices and grades against a rubric.