Softwr

Cloud · head to head

Amazon SQS vs AWS Lambda

Amazon SQS logo

Amazon SQS

Cloud

Fully managed message queues that decouple services, priced per request

From
On request
Free plan
No
AWS Lambda logo

AWS Lambda

Cloud

Run code without thinking about servers

From
Free
Free plan
Yes

The short version

  • Amazon SQS is a managed message queue; AWS Lambda is a serverless compute service.
  • AWS Lambda is free; Amazon SQS prices on request.
  • Only Amazon SQS lists long polling; only AWS Lambda lists event-driven execution.
  • Where Amazon SQS falls short: messages are deleted once consumed, so you cannot replay history the way you can with a log such as Kinesis or Kafka.
  • Where AWS Lambda falls short: provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs.

How do Amazon SQS and AWS Lambda differ?

Amazon SQS and AWS Lambda differ on starting price (On request against Free), pricing model and free tier (No against Yes). Only the attributes on which Amazon SQS and AWS Lambda actually diverge.

Attributes where Amazon SQS and AWS Lambda differ
AttributeAmazon SQSAWS Lambda
Starting priceOn requestFree
Pricing modelPer million requestsUsage-based
Free tierNoYes
PlatformsWeb, LinuxWeb, API

Not yet recorded: category for Amazon SQS, founded for Amazon SQS.

Which features does each one have?

They share no listed features; 6 appear only for Amazon SQS and 20 only for AWS Lambda. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Amazon SQS

  • Standard queues
  • FIFO queues
  • Dead-letter queues
  • Fair queues
  • Long polling
  • Server-side encryption

Only in AWS Lambda

  • Function-as-a-Service
  • Event-driven execution
  • Auto-scaling
  • Pay-per-use
  • Multiple languages
  • Concurrency limits
  • Dead Letter Queues
  • Environment variables

What is each one used for?

Amazon SQS is most often brought in for buffering bursts of work so a slower downstream service is not overwhelmed; AWS Lambda for event-driven functions without managing servers. The jobs each tool is most often brought in to do.

Amazon SQS

  • Buffering bursts of work so a slower downstream service is not overwhelmednot AWS Lambda
  • Triggering Lambda functions from a queue with automatic retries and a dead-letter queuenot AWS Lambda
  • Ordered processing of per-customer events using FIFO message groupsnot AWS Lambda
  • Splitting a monolith into services that talk through durable messagesnot AWS Lambda

AWS Lambda

  • Event-driven functions without managing serversnot Amazon SQS
  • API backends behind API Gatewaynot Amazon SQS
  • Processing S3, DynamoDB, SQS and Kinesis eventsnot Amazon SQS
  • Scheduled jobs without a always-on instancenot Amazon SQS
  • Edge compute through Lambda@Edgenot Amazon SQS

Where do Amazon SQS and AWS Lambda fall short?

Amazon SQS's most cited limit: messages are deleted once consumed, so you cannot replay history the way you can with a log such as Kinesis or Kafka. AWS Lambda's: ephemeral storage beyond the included 512 MB is metered. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Amazon SQS

  • Messages are deleted once consumed, so you cannot replay history the way you can with a log such as Kinesis or Kafka
  • Every API call is billed, including empty polls and deletes, so a badly configured short-polling consumer can cost more than the messages it handles
  • A single queue has one consumer group; delivering the same message to several systems requires an SNS topic fanning out to several queues
  • The maximum message size is small compared with data pipelines, so larger payloads must be stored in S3 and referenced
  • FIFO queues carry a higher rate and throughput limits that Standard queues do not have, which complicates scaling ordered workloads

AWS Lambda

  • Billed on two axes at once, $0.20 per million requests plus $0.0000166667 per GB-second of duration, so memory settings change the bill as much as traffic does
  • Provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs
  • Ephemeral storage beyond the included 512 MB is metered
  • Lambda@Edge costs $0.60 per million requests, three times the standard request rate
  • VPC use and cross-region data transfer carry EC2 charges on top

How much do Amazon SQS and AWS Lambda cost?

AWS Lambda is free to use. Plan by plan below, from each vendor's own pricing page.

Amazon SQS

On request
  • Standard queueOn request
    • First 1 million requests per month free
    • $0.40 per million requests in the first volume tier
    • Lower rates at very high volumes
  • FIFO queueOn request
    • $0.50 per million requests in the first volume tier
    • Ordering and deduplication by message group
  • Fair queue add-onOn request
    • $0.10 per million fair queue requests, charged on top of Standard rates

AWS Lambda

Free
  • Free TierFree
    • 1M free requests/month
    • 400,000 GB-seconds/month
    • Always free

Which should you pick?

Choose Amazon SQS if

  • You need standard queues.
  • You work on Web, Linux.
  • You also want fifo queues.

Choose AWS Lambda if

  • You need function-as-a-service.
  • You want to start without paying.
  • You work on Web, API.
  • You also want event-driven execution.

Questions people ask

Is Amazon SQS or AWS Lambda better?
It depends on the job. Amazon SQS fits buffering bursts of work so a slower downstream service is not overwhelmed; AWS Lambda fits event-driven functions without managing servers. Amazon SQS starts at On request and AWS Lambda at Free.
Which is cheaper, Amazon SQS or AWS Lambda?
AWS Lambda has a free tier; the other does not. Paid plans start at On request for Amazon SQS and Free for AWS Lambda.
Does Amazon SQS or AWS Lambda run on more platforms?
Amazon SQS runs on Web, Linux. AWS Lambda runs on Web, API.
Can I use AWS Lambda for free?
Yes. AWS Lambda has a free tier, so you can try it without paying. Amazon SQS starts at On request.
What is Amazon SQS best used for?
Amazon SQS is most often used for buffering bursts of work so a slower downstream service is not overwhelmed, triggering lambda functions from a queue with automatic retries and a dead-letter queue, ordered processing of per-customer events using fifo message groups, splitting a monolith into services that talk through durable messages. Of those, buffering bursts of work so a slower downstream service is not overwhelmed and triggering lambda functions from a queue with automatic retries and a dead-letter queue are not what AWS Lambda is typically brought in for.
What can Amazon SQS do that AWS Lambda cannot?
Amazon SQS covers Standard queues, FIFO queues, Dead-letter queues, Fair queues. AWS Lambda covers Function-as-a-Service, Event-driven execution, Auto-scaling, Pay-per-use.

Answered from the vendors’ own pages

Amazon SQS: Is SQS free?

The first 1 million requests each month are free across regions, per AWS. Beyond that you pay per million requests.

AWS Lambda: Is there a free tier for AWS Lambda?

Yes. AWS Lambda offers a free tier including 1 million requests per month, 400,000 GB-seconds per month, and 100 GB monthly response streaming.

Source
Amazon SQS: What is the difference between SQS and SNS?

SQS stores messages for a consumer to pull; SNS pushes one message to many subscribers. They are commonly combined.

AWS Lambda: How is AWS Lambda charged?

Lambda charges $0.20 per million requests. Duration charges are $0.0000166667 per GB-second for x86 (up to 6 billion GB-seconds/month in US East Ohio with tiered pricing). Ephemeral storage over the included 512 MB costs $0.0000000309 per GB-second. Provisioned Concurrency costs $0.0000041667 per GB-second with a 5-minute minimum.

Source
Amazon SQS: Does SQS guarantee order?

Only FIFO queues do, within a message group. Standard queues deliver at least once and may reorder.

AWS Lambda: What are Lambda Durable Functions pricing?

Lambda Durable Functions include operations at $8.00 per million (start execution, steps, waits). Data written costs $0.25 per GB. Data retention is $0.15 per GB-month with configurable 1-90 day retention (default 14 days).

Source
Share

Related pages

Other head to heads