SQS and EventBridge, while both AWS messaging services, solve fundamentally different problems, and picking the right one hinges on understanding their core mechanics.

Let’s see EventBridge in action. Imagine you have a new user signing up for your service. This event needs to trigger several things: sending a welcome email, creating a default user profile, and logging the signup for analytics.

Here’s how you’d set that up in EventBridge:

{
  "Source": "com.myapp.users",
  "DetailType": "UserSignup",
  "Detail": {
    "userId": "user-12345",
    "email": "newuser@example.com",
    "signupTimestamp": "2023-10-27T10:00:00Z"
  }
}

This is an event pattern. EventBridge doesn’t care who sent it, only that it matches a pattern defined by a target. You’d then create rules that match this pattern and point them to different targets.

Rule 1: Match {"DetailType": "UserSignup"}. Target: Lambda function sendWelcomeEmail. Rule 2: Match {"DetailType": "UserSignup"}. Target: Lambda function createUserProfile. Rule 3: Match {"DetailType": "UserSignup"}. Target: Kinesis Firehose stream signup-analytics.

When the UserSignup event is published to EventBridge, all three rules are evaluated, and if they match, the event is delivered to their respective targets. This is a one-to-many broadcast, decoupling the event producer from the consumers.

Now, let’s look at SQS. SQS is a message queue, designed for decoupling applications and buffering messages. It’s about reliably delivering individual messages to one, and only one, consumer.

Consider a scenario where you have a batch processing job. You want to process 1000 user-generated reports. Each report needs to be processed independently.

You’d send each report as a separate message to an SQS queue:

aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/123456789012/my-report-queue --message-body '{"reportId": "report-abc", "data": "..."}'

You’d send 1000 of these. Then, a fleet of worker instances (e.g., EC2 instances or Lambda functions) would poll the queue for messages.

aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/123456789012/my-report-queue --max-number-of-messages 10

Each worker would pick up a message, process the report, and then delete the message from the queue. If a worker crashes before deleting, the message will reappear in the queue after its visibility timeout, ensuring it gets processed eventually. This is designed for reliable, ordered (within a single consumer group if using FIFO queues), and guaranteed processing of individual tasks.

The core difference: EventBridge is an event bus – it routes events based on content to multiple interested parties. SQS is a message queue – it reliably delivers individual messages to a single consumer for processing.

EventBridge excels when a single event needs to trigger multiple, independent actions across different services. Think microservices communication, serverless orchestration, or integrating SaaS applications. It’s about reacting to things that happen.

SQS is your go-to for decoupling producers and consumers, buffering work, and ensuring reliable, one-time processing of discrete tasks. Think background jobs, asynchronous processing, or handling spikes in traffic. It’s about processing things that need to be done.

A common pattern is to use EventBridge to trigger an SQS queue. For example, a UserSignup event in EventBridge could trigger a Lambda function that then sends a message to an SQS queue for a long-running report generation task. This combines the broadcast nature of EventBridge with the reliable, decoupled processing of SQS.

Here’s a subtle but crucial point about EventBridge: when you define an event pattern, you’re not just filtering by Source and DetailType. You can get incredibly granular by matching on specific fields within the Detail payload. For instance, you could have a rule that only triggers if a UserSignup event has {"region": "us-west-2"} in its detail, or if a PaymentProcessed event has {"amount": "> 1000"}. This allows for highly specific routing based on the actual data within an event.

The next logical step in understanding AWS messaging is exploring how to manage the state and flow of complex, multi-step processes that go beyond simple event routing or task queuing.

Want structured learning?

Take the full Sqs course →