Softwr

Cloud · head to head

Amazon SNS vs AWS Lambda

Amazon SNS logo

Amazon SNS

Cloud

Publish-subscribe messaging and mobile push, billed per request and per delivery

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

  • AWS Lambda is a serverless compute service.
  • AWS Lambda is free; Amazon SNS prices on request.
  • Only Amazon SNS lists topics and subscriptions; only AWS Lambda lists event-driven execution.
  • Where Amazon SNS falls short: SMS pricing varies by country and can be expensive on international traffic, so an unbounded alert integration can generate a large bill.
  • 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 SNS and AWS Lambda differ?

Amazon SNS 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 SNS and AWS Lambda actually diverge.

Attributes where Amazon SNS and AWS Lambda differ
AttributeAmazon SNSAWS Lambda
Starting priceOn requestFree
Pricing modelPer request and per delivery, by protocolUsage-based
Free tierNoYes
PlatformsWeb, iOS, Android, LinuxWeb, API

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

Which features does each one have?

They share no listed features; 6 appear only for Amazon SNS 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 SNS

  • Topics and subscriptions
  • FIFO topics
  • Message filtering
  • Mobile push
  • SMS and email
  • Message archiving and replay

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 SNS is most often brought in for fanning one order event out to billing, fulfilment and analytics queues; AWS Lambda for event-driven functions without managing servers. The jobs each tool is most often brought in to do.

Amazon SNS

  • Fanning one order event out to billing, fulfilment and analytics queuesnot AWS Lambda
  • Sending operational alerts from CloudWatch alarms to email and chat webhooksnot AWS Lambda
  • Mobile push notifications for an app without running a push gatewaynot AWS Lambda
  • Pairing with SQS FIFO for ordered event distribution across servicesnot AWS Lambda

AWS Lambda

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

Where do Amazon SNS and AWS Lambda fall short?

Amazon SNS's most cited limit: payload-based filtering is charged per GB scanned per subscription, which adds cost at high volumes. 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 SNS

  • SMS pricing varies by country and can be expensive on international traffic, so an unbounded alert integration can generate a large bill
  • There is no message persistence for slow subscribers beyond delivery retries, so consumers that fall behind can lose messages unless an SQS queue sits between
  • It lacks the audience management, templating and campaign analytics of a marketing platform, so it cannot replace a customer messaging tool
  • Payload-based filtering is charged per GB scanned per subscription, which adds cost at high volumes
  • Delivery to HTTP endpoints requires your endpoint to confirm subscriptions and cope with retries and duplicates

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 SNS and AWS Lambda cost?

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

Amazon SNS

On request
  • Publishes and mobile pushOn request
    • First 1 million requests free, then $0.50 per million
    • Mobile push free for the first 1 million, then $0.50 per million
  • HTTP, HTTPS and emailOn request
    • HTTP and HTTPS: first 100,000 free, then $0.60 per million
    • Email: first 1,000 free, then $2.00 per 100,000
    • SQS and Lambda deliveries: no per-delivery charge
  • SMSOn request
    • Priced per message by destination country, see the SNS pricing page
    • Not covered by the free tier in most regions

AWS Lambda

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

Which should you pick?

Choose Amazon SNS if

  • You need topics and subscriptions.
  • You work on Web, iOS, Android, Linux.
  • You also want fifo topics.

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 SNS or AWS Lambda better?
It depends on the job. Amazon SNS fits fanning one order event out to billing, fulfilment and analytics queues; AWS Lambda fits event-driven functions without managing servers. Amazon SNS starts at On request and AWS Lambda at Free.
Which is cheaper, Amazon SNS or AWS Lambda?
AWS Lambda has a free tier; the other does not. Paid plans start at On request for Amazon SNS and Free for AWS Lambda.
Does Amazon SNS or AWS Lambda run on more platforms?
Amazon SNS runs on Web, iOS, Android, 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 SNS starts at On request.
What is Amazon SNS best used for?
Amazon SNS is most often used for fanning one order event out to billing, fulfilment and analytics queues, sending operational alerts from cloudwatch alarms to email and chat webhooks, mobile push notifications for an app without running a push gateway, pairing with sqs fifo for ordered event distribution across services. Of those, fanning one order event out to billing, fulfilment and analytics queues and sending operational alerts from cloudwatch alarms to email and chat webhooks are not what AWS Lambda is typically brought in for.
What can Amazon SNS do that AWS Lambda cannot?
Amazon SNS covers Topics and subscriptions, FIFO topics, Message filtering, Mobile push. AWS Lambda covers Function-as-a-Service, Event-driven execution, Auto-scaling, Pay-per-use.

Answered from the vendors’ own pages

Amazon SNS: Is Amazon SNS free?

The first 1 million requests per month are free, plus small free allowances for HTTP and email deliveries, per AWS. SMS is not free.

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 SNS: Does SNS keep messages?

Standard topics do not store messages for slow subscribers; durability comes from subscribing an SQS queue.

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 SNS: Can I send email with SNS?

Yes, for alerts, but it is plain notification email. Amazon SES is the service for transactional and bulk email.

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