Skip to content

Stream, Queue or Event Bus. What's the difference?

Published:

Queues, Streams, and Event Buses: Choosing the Right Message Channel

Have you ever found yourself trying to explain the difference between a queue, a stream, and an event bus, only to tie yourself in knots? You’re not alone! During a recent recording of the Ready Set Cloud podcast with Alan Hton, this seemingly straightforward question got me thinking deeply about these fundamental concepts in event-driven architecture.

Understanding Integration Patterns: The Foundation

Before we dive into the specifics of each message channel, let’s start with the two primary integration patterns that underpin them all:

Point-to-Point Integration

Publish-Subscribe Integration

Understanding these patterns is crucial because they influence when and why you’d choose each type of message channel.

Queues: Reliable Point-to-Point Communication

Think of a queue as a reliable postal service for your microservices. Here’s why queues are special:

Key Characteristics:

Perfect Use Cases:

Remember: If Service A sends a message and Service B is offline, the message waits safely in the queue until Service B comes back online. This durability makes queues excellent for reliable service integration.

Event Buses: Broadcasting Messages

An event bus is more like a radio station - broadcasting messages to anyone who’s listening.

Key Characteristics:

Perfect Use Cases:

One important note: Most event buses (like Amazon EventBridge) are ephemeral. If there’s no subscriber ready to receive a message, it’s typically dropped. This leads us to a common pattern: combining buses with queues.

The Power Combo: Buses and Queues Together

Here’s a pattern I often recommend:

  1. Use an event bus for broadcasting events
  2. Have each subscriber service set up its own queue
  3. Subscribe the queue to the event bus
  4. Have the service consume messages from its queue

This approach gives you the best of both worlds:

Streams: The Best of Both Worlds

Streams are fascinating because they sit somewhere between queues and buses. Think of them as a DVR for your data - you can watch live, or you can rewind and catch up on what you missed.

Key Characteristics:

Perfect Use Cases:

For example, with Amazon Kinesis, you get 24-hour retention by default, but you can extend this up to 365 days. Kafka can theoretically retain messages indefinitely.

Important Warning! Streams ≠ Databases

One crucial point: Don’t use streams as your database! Streams are for integration between services, not for permanent data storage. Each service should still maintain its own database.

Choosing the Right Channel

Here’s a quick decision guide:

Choose a Queue when:

Choose a Stream when:

Choose an Event Bus when:

The Reality Check

In real-world architectures, you’ll likely need all three patterns. The key is understanding where each shines and using them accordingly. Don’t force everything into one pattern - choose the right tool for each integration point.

Remember: It’s perfectly normal to have queues, streams, and event buses all working together in the same system. Each has its place, and understanding their strengths helps you build more robust, scalable architectures.


What’s your experience with these different message channels? Have you found interesting ways to combine them? Share your thoughts in the comments below!

Next up in our event-driven architecture series: We’ll dive deeper into implementing these patterns with specific services like Amazon SQS, Kinesis, and EventBridge. Stay tuned!