Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Architecture

What is the difference among SQS, SNS and Kafka?

SQS is a queue where each message is processed by one consumer, SNS fans one message out to many subscribers, and Kafka is a durable, replayable log read by many consumer groups.

Technologies
3
Difference questions
50

What each one is

Amazon SQS

A fully managed message queue.

Producers enqueue, one consumer processes each message, with retries and dead-letter queues.

Amazon SNS

A managed publish/subscribe service.

One published message is pushed to many subscribers: queues, Lambdas, HTTP endpoints, email or SMS.

Apache Kafka

A distributed, partitioned and replicated event log.

Consumer groups read at their own pace, events are retained and can be replayed, with ordering per partition.

At a glance

AspectAmazon SQSAmazon SNSApache Kafka
PatternQueue (point-to-point)Pub/sub fan-outLog / streaming
RetentionUp to 14 days, deleted when processedNot storedConfigurable, replayable
OrderingFIFO queuesFIFO topicsPer partition
OperationsFully managedFully managedSelf-managed or MSK / Confluent
Best forBackground jobsNotifications, fan-outEvent streaming, analytics

The 10 most-asked difference questions

Subjective questions 10

1What is the core difference between SQS, SNS and Kafka?Asked almost every time

SQS is a point-to-point queue: each message is processed by one consumer and then deleted. SNS is pub/sub: one published message is pushed to many subscribers, generally without storing it. Kafka is a durable, partitioned log: events are retained, and many consumer groups read them independently and can replay them.

2When would you choose SQS over Kafka?Asked almost every time

Choose SQS for background jobs and task distribution where each message needs one worker and no replay is needed. It is fully managed, scales without capacity planning, has built-in retries and DLQs, and is billed per request. Kafka adds partitions, brokers and offset management that a simple job queue does not need.

3What is the SNS plus SQS fan-out pattern and why is it so common?Asked almost every time

You publish once to an SNS topic and subscribe several SQS queues to it. Each queue gets its own copy and buffers messages durably, so each consumer service processes at its own pace, retries independently and survives downtime. SNS gives fan-out, and SQS adds the storage and retry layer that SNS lacks.

4Why can Kafka replay messages while SQS cannot?Asked almost every time

Kafka keeps events on disk for a configured retention period regardless of consumption. Consumers only track an offset, so you can reset it and reread history. SQS deletes a message once the consumer acknowledges it, so processed messages are gone. Only unprocessed messages remain, for up to 14 days.

5How do ordering guarantees differ across SQS, SNS and Kafka?Asked almost every time

SQS standard queues and SNS standard topics give best-effort ordering only. SQS FIFO queues and SNS FIFO topics guarantee order within a message group ID. Kafka guarantees order within a partition, and events with the same key go to the same partition. None of them gives global ordering at scale without limiting parallelism.

6What delivery semantics does each system provide?Asked almost every time

SQS standard and SNS standard are at-least-once, so duplicates can occur. SQS FIFO deduplicates within a 5-minute window for exactly-once processing on the queue side. Kafka is at-least-once by default. Idempotent producers and transactions give exactly-once for read-process-write flows within Kafka. External side effects still need idempotent consumers.

7How does consumer scaling work in SQS compared with Kafka?Asked almost every time

In SQS you add more consumers, and they all pull from the same queue. There is no partition limit, so scaling is nearly linear. In a Kafka consumer group, each partition is read by only one consumer. Parallelism is therefore capped by the partition count, and you must plan partitions in advance.

8An e-commerce order-placed event must trigger email, inventory update and analytics. Which would you pick and why?Asked almost every time

On AWS with modest volume, use SNS fanned out to three SQS queues. Each service gets an isolated, retryable copy. If analytics needs replay, high throughput or stream processing, publish to Kafka instead and give each service its own consumer group. That also lets you add new consumers later and backfill them from history.

9What happens to an SNS message if a subscriber is down?Very often asked

SNS retries delivery according to a retry policy that depends on the protocol. For HTTP endpoints this policy is configurable. If all retries fail, the message is dropped, unless a dead-letter queue is set on that subscription. SNS standard topics do not store messages for later reading. This is why SQS queues are usually placed behind SNS for durability.

10Can SNS store or replay messages at all?Very often asked

SNS standard topics do not retain messages. SNS FIFO topics support message archiving with a retention period, and subscribers can request a replay from that archive. That is a narrow feature, not a general replayable log like Kafka with consumer offsets.

See all 50 difference questions with answers in your dashboard →

Practise every comparison in your dashboard.

Start learning