/System Design /Message Queues ← All Designs
📨

Message Queues

Decouple producers and consumers for async, resilient communication

Async Decoupling
🎮 What you can do
  • Switch between Kafka and RabbitMQ
  • Set producers, partitions, and consumer count
  • Toggle Lag Mode to slow consumers and build a backlog
👁 What to watch
  • Messages stack in Kafka partitions, flow through RabbitMQ pipe
  • Consumer lag bar grows red when consumers fall behind
  • Throughput and lag stats update every second
Queue Type
Producers
Partitions
Consumers
Rate
Lag Mode
Consumers process at 20% speed — watch lag accumulate
Controls
Kafka
Partitioned commit log. Durable, replayable. Consumers track their own offset. Messages are ordered within a partition.
0
Total Produced
0
Total Consumed
0
Consumer Lag
0
Msgs/sec
Producers
Kafka Topic (1 Partition)
Consumers
When to Use
Order processing, analytics pipelines, microservice decoupling, event sourcing, log aggregation, real-time data streaming, IoT telemetry.
Trade-offs
At-least-once vs exactly-once. Ordering only within partition. Dead Letter Queue for failures. Backpressure when consumers are slow.
Interview Tip
Kafka consumer groups — each group independently tracks offsets, enabling multiple independent views of the same stream of data simultaneously.