Message push vs pull model

Published by

on

Push model is a model that broker pushes the message to the consumer, while pull model is a model that consumer pulls the message from the broker whenever consumer wants.

Pros and Cons

Push model
  • Pros
    • Optimized for latency
    • Client(Consumer) is lightweight. Broker handles most of the burden
    • Load balancing among competing consumers
  • Cons
    • Flow control
      • Control the speed of message push so that consumers don’t get overwhelmed
    • Broker logic is complex
  • ex)
    • RabbitMQ, ActiveMQ
Pull model
  • Pros
    • Optimized for throughput
    • Better suited for message replay
      • Consumer can send the offset they want to pull from to the broker
  • Cons
    • Polling in a tight loop
    • Client(Consumer) logic is complex
  • ex)
    • Kafka, SQS

Reference

Leave a comment