Technical
SQS vs EventBridge: How I Actually Decide
Every time I introduce messaging to a system, someone asks: SQS or EventBridge? They look similar. They both connect producers to consumers. But the choice has big implications and I have settled on a simple rule that has worked every time.
The One Question
Do I know the consumers? If yes, SQS. If no, or if there will be many, EventBridge.
SQS is point to point. One queue, usually one consumer or a small known set. The producer puts messages in the queue. The consumer reads them. The relationship is tight.
EventBridge is publish-subscribe. The producer emits an event. Many targets can subscribe. The producer does not care who listens. New subscribers can be added without changing the producer.
How This Plays Out
For my email sending subsystem, I use SQS. One producer (the app) and one consumer (the email Lambda). The flow is tight and well understood. SQS gives me dead letter queues, visibility timeouts, and simple retries. Perfect fit.
For a user-signup event, I use EventBridge. When a user signs up, I want to send a welcome email, add them to a newsletter list, create a CRM entry, and fire an analytics event. Each of those is a separate target. Adding a new one tomorrow does not require touching the signup code. The event-bus pattern makes the system easier to extend.
# SAM template snippet for both patterns
EmailQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: email-queue
VisibilityTimeout: 60
UserSignupBus:
Type: AWS::Events::EventBus
Properties:
Name: user-signup-bus
WelcomeEmailRule:
Type: AWS::Events::Rule
Properties:
EventBusName: !Ref UserSignupBus
EventPattern:
detail-type: [UserSignedUp]
Targets:
- Arn: !GetAtt WelcomeEmailFn.ArnThe Fallacy to Avoid
People reach for EventBridge because it sounds more sophisticated. It is not better. It is different. A queue with one producer and one consumer does not need the ceremony of an event bus. You pay complexity for a flexibility you do not use.
Default to SQS. Reach for EventBridge when you actually have or expect multiple subscribers. This rule has saved me from overengineering three times this quarter alone.
See the EventBridge vs SQS documentation for the official comparison. The rule of thumb above gets me to the right answer faster than any comparison chart.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read