Skip to content
We areTOP 1%

What is a message queue, and why would you use one?

EasyConceptMessage Queues & Event Streaming
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

A message queue is a durable buffer between services: producers append messages, and consumers take them off and process them asynchronously. Common examples are RabbitMQ, Amazon SQS and Kafka.

  • Decoupling: the producer does not need to know who consumes a message or whether the consumer is currently running.
  • Load levelling: a spike of requests is queued and drained at a steady rate instead of overwhelming a downstream service.
  • Reliability: messages persist until acknowledged, so failed processing can be retried; messages that fail repeatedly move to a dead-letter queue for inspection.
  • Scaling: adding consumers increases processing throughput.
  • Cost: extra latency, eventual consistency and another system to operate, so avoid a queue when the user needs the result immediately.

More in Message Queues & Event Streaming

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account