AWS Builder Center
Kafka vs SNS + SQS vs EventBridge: what changes for an event-driven system

Kafka vs SNS + SQS vs EventBridge: what changes for an event-driven system

Kafka keeps a log, SQS deletes what you consume. What that difference means for fan-out, ordering, replay, retries and choosing between SNS, SQS, EventBridge and MSK.

I’ve built event-driven services on Kafka for years, so when I started learning AWS messaging, my first question was what I’d lose and what I’d gain if the same system ran on SNS, SQS or EventBridge. Short answer: the services overlap less than their marketing suggests. They are built on a different model.

Log vs queue

Kafka is a log. A message written to a topic stays there for the retention period whether anyone read it or not. Each consumer group keeps its own offset, so two services can read the same events at different speeds, and a new service can start from the beginning of the topic next month.
SQS is a queue. A consumer receives a message, processes it and deletes it. After that it’s gone. Messages that nobody reads expire after the retention period (4 days by default, 14 at most).
Most design differences follow from this one.

Fan-out: consumer groups become queues

In Kafka, adding a consumer means adding a consumer group. The producer doesn’t change.
On AWS the usual equivalent is an SNS topic with one SQS queue per consuming service. SNS copies each message into every subscribed queue, and each service reads its own queue at its own pace. Adding a consumer means subscribing a new queue. Subscription filter policies let a queue receive only the messages it cares about, which in Kafka you’d do in the consumer code or with a separate topic.

Ordering

Kafka guarantees order within a partition, and the message key decides the partition. Use the order ID as the key, and all events for one order arrive in sequence.
Standard SQS queues give best-effort ordering, which in practice means none you can rely on. For ordering you need FIFO topics and queues, where the message group ID plays the role of the Kafka key. FIFO comes with lower throughput limits than standard queues, so check the current quotas before you design around it.

Replay

This is where the gap is widest. With Kafka, fixing a bug in a consumer often ends with resetting its offset and reprocessing the last day of events.
SQS can’t do that: processed messages are deleted. EventBridge has archive and replay, which helps, but replayed events are not guaranteed to arrive in the original order. If replay is part of how you operate, look at Kinesis Data Streams (retention up to 365 days, per-shard ordering) or simply run Kafka on Amazon MSK.

Retries and dead letters

Here AWS is ahead of plain Kafka. In SQS, a message that a consumer received but didn’t delete becomes visible again after the visibility timeout. After a set number of receives, a redrive policy moves it to a dead-letter queue automatically, and you can move it back from the console once the bug is fixed.
In Kafka you build this yourself: retry topics, a dead-letter topic, and an error handler that routes failed records. Spring Kafka makes it shorter, but it’s still your code and your topics.

EventBridge is a router

EventBridge sits a level above. Producers put events on a bus, and rules match on the event content (source, type, any field in the payload) and route them to targets: Lambda, SQS, Step Functions, other buses, even other accounts. AWS services emit their own events to it, so “do X when an EC2 instance stops” needs no code on the producer side.
It’s not built for high-volume streaming. Latency is higher than SQS, throughput has per-region quotas, and there’s no consumer-controlled pacing. It fits integration events between domains or teams better than the hot path of a single service.

What stays the same

Some problems don’t care which broker you use:
  • Writing to the database and publishing an event is still not atomic. You need the transactional outbox pattern on AWS as much as with Kafka.
  • Delivery is at least once. Standard SQS and SNS can deliver duplicates, and so can Kafka consumers after a rebalance. Consumers must be idempotent.
  • Large payloads don’t belong in messages. Put the body in S3 and send a reference.

How I’d choose

If you need
Use
Replay, long retention, stream processing
MSK (Kafka) or Kinesis Data Streams
Work distribution with built-in retries and DLQ
SQS
One event, many independent consumers
SNS + SQS
Content-based routing between teams or AWS services
EventBridge
A system I’d design on AWS would likely mix them: Kafka-style streams where history matters, SNS and SQS for commands and fan-out between services, and EventBridge at the edges where domains meet.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article