Updated Nov 30, 20268 min read

Amazon SQS Alternatives for Queues and Background Jobs

The main alternatives to Amazon SQS compared on delivery guarantees, ordering, retention and replay, retries and dead-letter handling, and operations, with an example of a queue-backed service that runs in your own AWS or GCP account.

Illustration for Amazon SQS Alternatives for Queues and Background Jobs

Amazon SQS is the default queue on AWS, and for handing work between services it needs almost no setup. The friction is in the details: standard queues deliver out of order, FIFO queues allow 300 transactions per second per partition unless high throughput mode is on, and messages cannot exceed 1 MiB.

The alternatives differ in what they take on instead, usually more operations in exchange for routing, replay or ordering.

SQS alternatives at a glance

EncoreGoogle Pub/SubRabbitMQApache KafkaNATS JetStreamBullMQ
What it isBackend framework with built-in infrastructureManaged topics and subscriptionsBroker with exchanges and queuesPartitioned, replicated logPersistence layer for NATSJob queue library on Redis
DeliveryAt least once or exactly once, set per topicAt least once, exactly once per subscriptionAt least once with acknowledgementsAt least once, offsets kept by consumersAt least once with acknowledgementsAt least once, jobs retried on failure
OrderingPer key with OrderingAttributePer ordering key, 1 MBps eachPer queuePer partitionPer streamPer queue, by priority and insertion
ReplayFailed events in a dead-letter queueSeek and retention up to 31 daysNot a log, streams cover replayRead from any retained offsetConsumers start from any sequence or timeNot a log
You operateNothing, resources are created in your cloud accountNothingBrokers, or a hosted serviceBrokers, or a hosted serviceServers, or a hosted serviceRedis
Local developmentencore run runs topics in processEmulatorContainerContainerServer binaryRedis
SQS for comparison
CapabilityAmazon SQS
Message sizeUp to 1 MiB, larger payloads through the S3-based extended client
Retention4 days by default, 60 seconds to 14 days
Visibility timeout30 seconds by default, up to 12 hours
OrderingFIFO queues with message groups, 300 transactions per second per partition and action
Pricing1 million requests free each month, then per request, with each 64 KB of payload billed as one request

SQS figures are from the message quotas and pricing page, checked November 30, 2026.

1. Encore

Encore

Encore is a backend framework with built-in infrastructure, so a topic and its subscriptions are declared next to the endpoints that publish and consume them, and the queue behind them is created in your own cloud account. On AWS that is an SNS topic with an SQS queue and a dead-letter queue per subscription, and on GCP it is Pub/Sub, as the AWS docs and GCP docs describe. The same code runs on either cloud, and encore run runs the topic in process, so a queue-backed flow can be tested on a laptop without an emulator.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.

Set up the app

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create ledger --example=hello-world$ cd ledger && mkdir -p balances/migrations

Account events are the usual case for an ordered queue, since a withdrawal must not be applied before the deposit that funds it. This service publishes events with an ordering key, and the subscriber records each event identifier so that a redelivery changes nothing:

// balances/balances.go package balances import ( "context" "strings" "time" "encore.dev/beta/errs" "encore.dev/pubsub" "encore.dev/storage/sqldb" ) var db = sqldb.NewDatabase("balances", sqldb.DatabaseConfig{Migrations: "./migrations"}) type AccountEvent struct { AccountID string `pubsub-attr:"account_id" json:"account_id"` EventID string `json:"event_id"` Cents int64 `json:"cents"` } var AccountEvents = pubsub.NewTopic[*AccountEvent]("account-events", pubsub.TopicConfig{ DeliveryGuarantee: pubsub.AtLeastOnce, OrderingAttribute: "account_id", }) // Record publishes an event, keyed by account so events for one account stay in order. // //encore:api public method=POST path=/events func Record(ctx context.Context, e *AccountEvent) error { if strings.TrimSpace(e.AccountID) == "" || strings.TrimSpace(e.EventID) == "" || e.Cents == 0 { return &errs.Error{Code: errs.InvalidArgument, Message: "account_id, event_id and a non-zero cents are required"} } _, err := AccountEvents.Publish(ctx, e) return err } type Balance struct { AccountID string `json:"account_id"` Cents int64 `json:"cents"` } //encore:api public method=GET path=/balances/:account func Get(ctx context.Context, account string) (*Balance, error) { b := Balance{AccountID: account} err := db.QueryRow(ctx, `SELECT cents FROM balances WHERE account_id = $1`, account).Scan(&b.Cents) if err != nil && err != sqldb.ErrNoRows { return nil, err } return &b, nil } func apply(ctx context.Context, e *AccountEvent) error { tx, err := db.Begin(ctx) if err != nil { return err } defer tx.Rollback() // The event identifier makes a redelivery a no-op. res, err := tx.Exec(ctx, `INSERT INTO processed_events (event_id) VALUES ($1) ON CONFLICT DO NOTHING`, e.EventID) if err != nil { return err } if res.RowsAffected() == 0 { return nil } _, err = tx.Exec(ctx, ` INSERT INTO balances (account_id, cents) VALUES ($1, $2) ON CONFLICT (account_id) DO UPDATE SET cents = balances.cents + EXCLUDED.cents`, e.AccountID, e.Cents) if err != nil { return err } return tx.Commit() } var _ = pubsub.NewSubscription(AccountEvents, "update-balance", pubsub.SubscriptionConfig[*AccountEvent]{ Handler: apply, AckDeadline: 30 * time.Second, RetryPolicy: &pubsub.RetryPolicy{MinBackoff: 5 * time.Second, MaxBackoff: 2 * time.Minute, MaxRetries: 5}, })
-- balances/migrations/1_create_balances.up.sql CREATE TABLE balances ( account_id TEXT PRIMARY KEY, cents BIGINT NOT NULL ); CREATE TABLE processed_events ( event_id TEXT PRIMARY KEY, processed_at TIMESTAMPTZ NOT NULL DEFAULT now() );

encore run starts Postgres locally, applies the migration and delivers events to the subscriber in process. Posting the same event twice is how you exercise the idempotency path: the subscriber records the event identifier and applies the balance change only on the first delivery. The OrderingAttribute has no effect in local environments, which the Pub/Sub docs note along with the retry policy and the dead-letter queue, so ordering is verified after a deploy. Events that exceed MaxRetries land in the subscription's dead-letter queue and can be released once the bug is fixed.

To deploy, follow Connect your cloud account and push, and the SNS topic, the SQS queues and the RDS database appear in your AWS account, or the Pub/Sub topic and Cloud SQL database in GCP. An AI coding agent adding a second consumer, such as an audit trail, declares one more subscription and gets its own queue in the same change that adds the handler.

Best fit: Teams that want queue-backed work in their own AWS or GCP account, with ordering, retries and dead-letter queues declared in the service code.

2. Google Cloud Pub/Sub

Google Cloud Pub/Sub

Pub/Sub is the managed topic and subscription service on Google Cloud, with a message size of up to 10 MB, subscription retention of 7 days by default and topic retention of up to 31 days, so a subscriber can seek back to replay messages that SQS would already have dropped. Ordering keys keep messages for one key in sequence at up to 1 MBps per key, and exactly-once delivery is a per-subscription setting with regional throughput quotas, all listed on the Pub/Sub quotas page. It fits teams that already run on Google Cloud and want a queue with replay without operating brokers.

3. RabbitMQ

RabbitMQ

RabbitMQ is a broker with exchanges that route messages to queues, which covers topic routing, priorities and delayed retries that SQS leaves to the application. Its quorum queues are replicated with Raft and are the recommended type when a queue has to survive node loss, with poison message handling, dead-lettering and consumer timeouts documented in the quorum queues guide. Classic queue mirroring was removed in RabbitMQ 4.0. The cost is that someone runs the cluster, or pays a hosted provider to, and sizes memory and disk for the backlog.

4. Apache Kafka

Apache Kafka

Apache Kafka stores messages in partitioned, replicated logs that consumers read at their own pace, with retention set by time or size rather than by acknowledgement. Several consumer groups read the same data independently and can rewind to an earlier offset, and ordering holds within a partition. There is no per-message visibility timeout, delay or retry queue, so a failed message is handled by the consumer itself. Kafka fits event streams and data pipelines, and it is more machinery than a work queue needs.

5. NATS JetStream

NATS JetStream

NATS JetStream adds persistence to the NATS messaging system through streams and consumers: a stream stores messages for one or more subjects, and a durable consumer tracks which messages a client has acknowledged and redelivers the rest. A consumer can start from the beginning, the latest message, a sequence number or a point in time. It is a small binary to run and fits teams that already use NATS for service messaging and want durable delivery on top.

6. BullMQ

BullMQ

BullMQ is a job queue library for Node.js that stores jobs in Redis, with delayed jobs, retries with backoff and rate limiting built in. A producer and a worker are a few lines of code, which makes it popular for sending email or resizing images from a Node service. The queue is only as durable as the Redis behind it, so persistence and failover settings become part of the design.

How to choose

Pick Pub/Sub on Google Cloud for a managed queue with replay, RabbitMQ for routing and delayed retries, Kafka for replayable event streams and NATS JetStream for lightweight durable messaging. Pick BullMQ for a Node.js service that already runs Redis. Pick Encore when the queue should be a topic declared in the service code, running on SQS and SNS in your own AWS account or on Pub/Sub in GCP, with retries and dead-letter queues created for you.

Frequently asked questions

What is the best alternative to Amazon SQS?

Google Cloud Pub/Sub is the closest managed equivalent, RabbitMQ is the closest broker with routing and per-message acknowledgements, and Kafka is the choice when consumers need to replay a log. Encore is the option when the queue should be declared in application code and run on SQS and SNS in your own AWS account or on Pub/Sub in GCP.

What are the limits of Amazon SQS?

A message can be up to 1 MiB, a standard queue keeps messages for 4 days by default and up to 14 days, and the visibility timeout defaults to 30 seconds with a 12 hour maximum. FIFO queues allow 300 transactions per second per partition and API action unless high throughput mode is enabled.

Is Kafka a replacement for SQS?

No. Kafka is a replacement only when the workload needs a replayable log. Kafka keeps messages for a configured retention period and lets each consumer group read from any offset, but it has no per-message visibility timeout or delay, so work queues with retries are usually simpler on SQS, RabbitMQ or Pub/Sub.

How do I use a queue in my backend without writing SQS code?

Declare a topic and a subscription in code with Encore, set a retry policy on the subscription and deploy to your own AWS account. Encore creates the SNS topic, the SQS queue and the dead-letter queue, and runs the same topic in process during encore run.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders