Build a Message Queue (RabbitMQ / SQS)

About Build a Message Queue (RabbitMQ / SQS)

A point-to-point work queue — the messaging primitive Kafka is NOT. Each message goes to one consumer, ack deletes, retries push to a dead-letter queue, and a poisoned message is everyone's problem. Internalize ack vs visibility timeout vs DLQ vs prefetch vs FIFO groups — and learn to tell when Kafka is the wrong tool and when a queue is.

Difficulty
intermediate
Time
about 80 minutes
Stages
9
Topic
Queues, Pub/Sub & Event Streaming

How this problem is worked

Nine stages, from what the thing is for to how it compares with the real implementations. Each asks one question, and the simulator runs the architecture you draw against the requirements you wrote.

  1. 01Purpose & invariantsWhat is this for, and what must always be true of it?
  2. 02Workload characterizationWho writes, who reads, and in what shapes?
  3. 03Data model & on-disk formatWhat does the data look like at rest?
  4. 04Core algorithmsHow do the write path and the read path actually work?
  5. 05Distribution & replicationHow does this scale out and survive losing a machine?
  6. 06Consistency & correctnessUnder concurrency and failure, what is guaranteed?
  7. 07Failure modes & recoveryWhat actually happens when each part fails?
  8. 08Operational characteristicsCan a human run this at three in the morning?
  9. 09Trade-offs & comparisonWhere does this sit against the alternatives?

Primary sources for this problem

  • RabbitMQ Tutorials — Work Queues, Routing, Consumer Acknowledgements (rabbitmq.com/docs/tutorials)
  • AWS SQS Developer Guide — Standard vs FIFO, Visibility Timeout, Dead-letter queues (docs.aws.amazon.com/AWSSimpleQueueService)
  • Hohpe & Woolf — Enterprise Integration Patterns: Competing Consumers, Dead Letter Channel, Idempotent Receiver (enterpriseintegrationpatterns.com)
  • Kleppmann — Designing Data-Intensive Applications, ch. 11 (messaging vs streaming)
  • AMQP 0-9-1 overview (rabbitmq.com/amqp-0-9-1-overview.html)

Browse the full problem catalog, or see what the simulator does and does not model.