More comparisons

Amazon API Gateway vs Amazon SNS

This Amazon API Gateway vs Amazon SNS comparison was created based on reviews from developers and our best attempts to perform analysis by looking at documentation and other publicly available resources.

Easily build complete, trusted realtime functionality.

Take our APIs for a spin

Amazon API Gateway

Amazon SNS

Getting started and developer experience

Time to "hello world"

Reviewed by 3+ independent developers

Ratings were given based on the average amount of time it takes to sign up to a new account and publish the first message.

4 / 5

5 = <30 min
4 = 30 min - 1 h
3 = 1-2 h
2 = 2-4 h
1 = 4+ h

View code example
4 / 5

5 = <30 min
4 = 30 min - 1 h
3 = 1-2 h
2 = 2-4 h
1 = 4+ h

View code example

Demos / Tutorials

A selection of online demos and tutorials so you can test and see the code in action.

Explore Ably's tutorials for our pub/sub messaging platform

Documentation

Reviewed by 3+ independent developers

Explore Ably's documentation for our pub/sub messaging platform
4.33 / 5

Getting started guides / 5

Information architecture and developer journey / 5

API reference documentation / 5

Readability, design and navigation / 5

Quality of code / 5

Breadth and quality of tutorials / 5

“The Amazon API Gateway documentation is broadly partitioned into getting started guides, tutorials, service features, references, and misc info, such as FAQs. The information architecture and navigation experience are mostly good. However, the developer journey is not straightforward since API Gateway works with other AWS services, such as IAM and AWS Lambda. You need to look at the respective products' documentation to understand how they work together with the API Gateway. The documentation provides tutorials for most API Gateway features, but the code examples are limited to Node.js and Python.”

4 / 5

Getting started guides / 5

Information architecture and developer journey / 5

API reference documentation / 5

Readability, design and navigation / 5

Quality of code / 5

Breadth and quality of tutorials / 5

"The Amazon documentation is comprehensive and, unlike many other products, clearly states what you can use Amazon SNS for. Several pages are dedicated to explaining in detail how FIFO topics (which provide superior quality of service) work. Overall, the developer guide might not deserve its name since it’s mostly a product guide. Its primary focus is on explaining things conceptually and performing operations in the AWS console. There’s a limited number of code snippets embedded in the dev guide, and only in a couple of languages. Fortunately, the API documentation is very detailed, although it’s inconsistently presented across languages, and you won’t always find code snippets in your language of choice. The official tutorials are poor, only cover some basics, and focus almost entirely on the AWS console."

Dashboard or dev console

Reviewed by 3+ independent developers

Sign up for free and explore Ably's pub/sub messaging platform
4.33 / 5

Ease of use / 5

Stats and reports / 5

Functionality / 5

“The Amazon API Gateway console is easy to use, but only once you know your way around it. More tooltips and contextual help would have been great. The console provides ways of creating APIs and integrating them with backend services.  It also provides different metrics, such as the number of API calls and errors or latency-related stats. The console has all required core functionality for API configuration options such as updating, deleting, deploying, or integrating them with various services. The interface could do with a refresh, as the design is by no means visually appealing.”

4 / 5

Ease of use / 5

Stats and reports / 5

Functionality / 5

"Getting started with the SNS console as a new user can be a confusing and slightly painful experience (unless you look at the documentation in parallel). That’s because the website itself is clunky and not very easy to navigate. On the other hand, the console allows you to configure your pipeline down to the smallest details, so it’s hard to wrap up all the existing features in an easy to use package. The reporting available is good, but there’s always room for improvement. Analytics on message origin would be beneficial."

SDKs

Note: Only official SDKs were taken into account.

Explore Ably's 25+ SDKs for our pub/sub messaging platform

8 AWS SDKs to use the Amazon API Gateway service

Including:

  • JavaScript

  • Java

  • PHP

Note that when you create REST APIs with Amazon API Gateway, you can also generate client SDKs, enabling clients to call your REST APIs in a platform or language-specific way (e.g., JavaScript, Android, iOS).

9 SDKs

Including:

  • Ruby

  • .NET

  • JavaScript

API structure

Reviewed by 3+ independent developers

4.25 / 5

API consistency across SDKs / 5

Well structured / 5

Intuitive / 5

Simple / 5

“The Amazon API Gateway service APIs are part of the standard AWS SDKs. The API Gateway docs provide separate reference pages for each programming language. The APIs are largely consistent, barring some language-specific constructs. Once you learn your way around the console and go through the API reference, the APIs are pretty easy to use.”

3.75 / 5

API consistency across SDKs / 5

Well structured / 5

Intuitive / 5

Simple / 5

"The API has a good naming convention, which makes it intuitive. Syntactically, the API structure is mostly uniform across different programming languages. The extensive API reference is an invaluable resource for getting started with Amazon SNS. It’s not the most straightforward service to use - for example, the opt-in process for e-mail and SMS notifications is cumbersome, and there aren’t enough debugging options."

Amazon API Gateway

Amazon SNS

"Hello world" code example
// Note: The code below demonstrates how AWS API Gateway works with AWS Lambda

// AWS APIGateway configuration required to handle AWS Lambda service

'use strict';
console.log('Loading hello world function');
 
exports.handler = async (event) => {
    let name = "you";
    let city = 'World';
    let time = 'day';
    let day = '';
    let responseCode = 200;
    console.log("request: " + JSON.stringify(event));
    
    if (event.queryStringParameters && event.queryStringParameters.name) {
        console.log("Received name: " + event.queryStringParameters.name);
        name = event.queryStringParameters.name;
    }
    
    if (event.queryStringParameters && event.queryStringParameters.city) {
        console.log("Received city: " + event.queryStringParameters.city);
        city = event.queryStringParameters.city;
    }
    
    if (event.headers && event.headers['day']) {
        console.log("Received day: " + event.headers.day);
        day = event.headers.day;
    }
    
    if (event.body) {
        let body = JSON.parse(event.body)
        if (body.time) 
            time = body.time;
    }
 
    let greeting = `Good ${time}, ${name} of ${city}.`;
    if (day) greeting += ` Happy ${day}!`;

    let responseBody = {
        message: greeting,
        input: event
    };
    
    // The output from a Lambda proxy integration must be 
    // in the following JSON object. The 'headers' property 
    // is for custom response headers in addition to standard 
    // ones. The 'body' property  must be a JSON string. For 
    // base64-encoded payload, you must also set the 'isBase64Encoded'
    // property to 'true'.
    let response = {
        statusCode: responseCode,
        headers: {
            "x-custom-header" : "my custom header value"
        },
        body: JSON.stringify(responseBody)
    };
    console.log("response: " + JSON.stringify(response))
    return response;
};
//PUBLISH MESSAGE
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set region
AWS.config.update({region: 'REGION'});

// Create promise and SNS service object
var createTopicPromise = new AWS.SNS({apiVersion: '2010-03-31'}).createTopic({Name: "TOPIC_NAME"}).promise();

// Handle promise's fulfilled/rejected states
createTopicPromise.then(
  function(data) {
    console.log("Topic ARN is " + data.TopicArn);
  }).catch(
    function(err) {
    console.error(err, err.stack);
  });

//SUBSCRIBE TO A TOPIC
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set region
AWS.config.update({region: 'REGION'});

// Create subscribe/email parameters
var params = {
  Protocol: 'EMAIL', /* required */
  TopicArn: 'TOPIC_ARN', /* required */
  Endpoint: 'EMAIL_ADDRESS'
};

// Create promise and SNS service object
var subscribePromise = new AWS.SNS({apiVersion: '2010-03-31'}).subscribe(params).promise();

// Handle promise's fulfilled/rejected states
subscribePromise.then(
  function(data) {
    console.log("Subscription ARN is " + data.SubscriptionArn);
  }).catch(
    function(err) {
    console.error(err, err.stack);
  });

Amazon API Gateway

Amazon SNS

Realtime features

Pub/Sub messaging

Pub/Sub is a design pattern that lets any number of publishers (producers) push messages to channels (also known as topics). Multiple subscribers (consumers) can subscribe to a channel to consume published messages.

Explore Ably's pub/sub messaging implementation

Message queues

A message queue is a form of asynchronous service-to-service communication. Messages are stored on a queue until they are processed. Note that each message is only consumed by one subscriber (consumer).

Explore Ably's message queues implementation

Limited

Amazon SNS integrates with Amazon SQS (Simple Queue Service) in order to offer traditional message queue functionality. However, Amazon SNS does not provide message queues by itself.

Presence

Presence enables you to track the online and offline status of devices and end-users in real time and to store their state. Essential for chat apps and multiplayer games.

Explore Ably's presence implementation

Message history

Message history provides a means to retrieve previously published messages. For this to be possible, message data must be stored (persisted) somewhere.

Explore Ably's message history implementation

Connection state recovery (stream resume)

In the case of unreliable network conditions, clients may suddenly disconnect.Connection state recovery ensures that when they reconnect, the data stream resumes exactly where it left off.

Explore Ably' s connection state recovery implementation

N/A

Guaranteed message ordering

Ordering ensures that messages are delivered to consumers in the same order that producers publish them.

Explore Ably' s guaranteed message ordering implementation

Limited

Amazon SNS guarantees message ordering via FIFO topics. However, ordering is only guaranteed when sending messages to Amazon SQS FIFO queues.

Exactly-once semantics

Exactly-once is a system-wide data integrity guarantee that ensures each message is delivered to consumers exactly-once.

Explore Ably' s idempotent publishing implementation

Limited

Amazon SNS guarantees exactly-once semantics via FIFO topics. However, it only supports exactly-once when sending messages to Amazon SQS FIFO queues.

Message delta compression

Message delta compression enables you to only send the changes from the previous message to subscribers each time there’s an update, instead of the entire message. Useful for use cases where there is a significant degree of similarity between successive messages.

Explore Ably' s message delta compression implementation

Native push notifications

Native push notifications can be used to deliver messages even when clients are offline. Useful for geolocation updates or news alerts.

Explore Ably's push notifications implementation

Webhooks

Webhooks provide a mechanism to get messages and other types of events (such as clients entering or leaving channels) pushed to your servers over HTTP.

Explore Ably's webhooks implementation

Serverless functions

A serverless function is essentially an isolated, single-purpose piece of code that is only executed when it’ triggered by an event. For example, you can use serverless functions to send a welcome message to clients when they become present on chat channels.

Note that serverless functions are usually fully managed by cloud vendors.

Explore Ably's serverless functions implementation

Limited

Can only trigger AWS Lambda functions. Amazon API Gateway doesn’t have in-built support for other serverless platforms, such as Azure Functions or Google Cloud Functions.

Limited

Can only invoke AWS Lambda Functions. Amazon SNS does not support other serverless platforms, such as Azure Functions or Google Cloud Functions.

Built-in integrations

Which popular services & systems are Amazon API Gateway and Amazon SNS integrated with?

Explore Ably's library of integrations

Webhooks

  • Custom
  • IFTTT
  • Zapier

Serverless functions

  • AWS Lambda
  • Cloudflare Workers
  • Google Cloud Functions
  • Microsoft Azure Functions

Streaming

  • Apache Kafka
  • Apache Pulsar
  • Amazon Kinesis
  • Amazon SQS
  • RabbitMQ
  • AMQP

Webhooks

  • Custom
  • IFTTT
  • Zapier

Serverless functions

  • AWS Lambda
  • Cloudflare Workers
  • Google Cloud Functions
  • Microsoft Azure Functions

Streaming

  • Apache Kafka
  • Apache Pulsar
  • Amazon Kinesis
  • Amazon SQS
  • RabbitMQ
  • AMQP

Known limits and constraints

Find out practical limits, such as the maximum message size, or the maximum number of concurrent connections.

Explore the practical limits of the Ably pub/sub messaging platform

Throughput

10.000 requests per second (default quota)

Maximum message size

128 KB for WebSocket APIs

10 MB for REST APIs

Maximum number of channels

N/A

Maximum number of concurrent connections

Amazon API Gateway doesn't enforce a quota on concurrent connections. The maximum number of concurrent connections is determined by the rate of new connections per second and a maximum connection duration of two hours.

Publisher throughput

Default quota of 20 SMS messages per second, and 10 email messages per second. 

Maximum message size

256 KB

Maximum number of topics

Default quota of 100.000 standard topics/account and 1.000 FIFO topics/account

Maximum number of subscriptions

Default quota of 12.500.000 subscriptions / standard topic and 100 subscriptions / FIFO topic

Supported development platforms, languages, open protocols and cloud models

Development platforms & operating systems

Which popular development platforms and operating systems do Amazon API Gateway and Amazon SNS support via official SDKs?

Explore the development platforms supported by Ably
  • Android
  • Java / JVM
  • iOS
  • macOS
  • iPadOS
  • tvOS
  • watchOS
  • Mono
  • .NET
  • Android
  • Java / JVM
  • iOS
  • macOS
  • iPadOS
  • tvOS
  • watchOS
  • Mono
  • .NET

Languages

Which popular programming languages do Amazon API Gateway and Amazon SNS support via offical SDKs?

Explore the programming languages supported by Ably
  • JavaScript
  • Node.js
  • TypeScript
  • Java
  • Objective-C
  • Swift
  • Go
  • PHP
  • Python
  • Ruby
  • Flutter
  • Clojure
  • Scala
  • JavaScript
  • Node.js
  • TypeScript
  • Java
  • Objective-C
  • Swift
  • Go
  • PHP
  • Python
  • Ruby
  • Flutter
  • Clojure
  • Scala

Open protocols

Which popular open protocols do Amazon API Gateway and Amazon SNS support?

Explore the open protocols supported by Ably
  • WebSocket
  • HTTP
  • AMQP
  • MQTT
  • STOMP
  • SSE
  • Webhooks
  • WebSocket
  • HTTP
  • AMQP
  • MQTT
  • STOMP
  • SSE
  • Webhooks

Cloud models

Which popular cloud models do Amazon API Gateway and Amazon SNS support?

  • Self-hosted
  • Cloud-managed
  • Serverless
  • Globally-distributed
  • Self-hosted
  • Cloud-managed
  • Serverless
  • Globally-distributed
Global and reliable edge service

Edge messaging network with latency-based routing

Latency-based routing ensures that clients are always routed to the nearest datacenter and point of presence.

Explore Ably's routing mechanism that mitigates network and DNS issues

Multi-region data replication (message durability)

Multi-region data replication (storage) protects against single points of failure and ensures message data durability.

Learn how Ably ensures message durability

Uptime SLAs

Here’s what the most common SLAs amount to in terms of downtime over a calendar year:

99.999% SLA = 5m 15s downtime per year

99.99% SLA = 52m 35s downtime per year

99.95% SLA = 4h 22m 58s downtime per year

99.9% SLA = 8h 45m 56s downtime per year

99% SLA = 3d 15h 39m 29s downtime per year

Source: https://uptime.is/

99.95%

99.9%

Quality of Service

What QoS guarantees do Amazon API Gateway and Amazon SNS provide natively?

Explore Ably's availability and uptime guarantees for our pub/sub messaging platform
  • Multi-region data replication (storage)
  • Exactly-once semantics
  • Guaranteed message ordering
  • Connection state recovery (stream resume)
  • Multi-region data replication (storage)
  • Exactly-once semantics
  • Guaranteed message ordering
  • Connection state recovery (stream resume)
Security

API key authentication

The simplest way to authenticate. Involves using private API keys that you can usually create and edit via a dashboard. Recommended to be used server-side, as private API keys shouldn’t be shared with untrusted parties.

Explore Ably's implementation of API key authentication

Token-based authentication

Which popular token-based authentication mechanisms do Amazon API Gateway and Amazon SNS support?

Note that token-based authentication is usually the recommended strategy on the client-side as it provides more fine-grained access control and limits the risk of credentials being compromised.

Explore Ably's implementation of token-based authentication
  • Ephemeral tokens
  • JWTs
  • Ephemeral tokens
  • JWTs

Configurable rules and permissions

Which types of configurable rules and permissions do Amazon API Gateway and Amazon SNS support?

Explore Ably's configurable rules and permissions
  • API keys rules and permissions
  • Operation rules and permissions
  • Admin rights
  • API keys rules and permissions
  • Operation rules and permissions
  • Admin rights

Message encryption

Which types of message encryption do Amazon API Gateway and Amazon SNS support?

Explore Ably's message encryption mechanisms
  • Encrypted at rest
  • Encrypted in transit
  • Message payload encryption
  • Encrypted at rest
  • Encrypted in transit
  • Message payload encryption

Formal certifications

Which formal certifications are Amazon API Gateway and Amazon SNS compliant with?

Explore Ably's security and compliance for our pub/sub messaging platform
  • SOC 2 TYPE I
  • SOC 2 Type II
  • HIPAA
  • EU GDPR
  • SOC 2 TYPE I
  • SOC 2 Type II
  • HIPAA
  • EU GDPR
Pricing & Support

Free package

What do the free packages offered by Amazon API Gateway and Amazon SNS consist of?

Explore Ably's free package for our pub/sub messaging platform

The Amazon API Gateway free package includes one million API calls received for REST APIs, one million API calls for HTTP APIs, one million messages, and 750,000 connection minutes for WebSocket APIs per month for up to 12 months. Beyond the 12 months, there is no free package.

Each month, Amazon SNS offers the following for free, but only for Standard topics: 

- 1 million requests per month

- 100 SMS notifications (sent to US phone numbers)

 -1.000 Email/JSON notifications

- 100.000 HTTP/s notifications  

Note: with the exception of SMS messages, each 64KB chunk of delivered data is billed as 1 delivery. For example, a single notification with a 256KB payload is billed as four deliveries.

Pricing model

How are the Amazon API Gateway and Amazon SNS pricing models calculated?

Explore Ably's pricing model for our pub/sub messaging platform

Amazon API Gateway pricing is usage-based and calculated per month.

HTTP APIs

You pay for the number of API calls per month:

- $1 per million calls for the first 300 million. 

- For 300+ million calls, the price is $0.90 per million.

REST APIs

You pay for the number of requests per month:

- $3.50 per million calls for the first 333 million requests. 

- For the next 667 million requests, the price is $2.80 per million.

You can optionally provision dedicated caching for REST APIs, which is also charged. For example, the price for a cache memory size of 237 GB is $3.80 per hour.

WebSocket APIs

You pay for message transfer (requests) and connection minutes:

- $1 per million requests per month (for the first 1 billion. If you exceed 1 billion requests, the pricing is $0.80 per million). 

- $0.25 per million connection minutes. 

Note that we have used US East (Ohio) as a reference point, but the pricing values differ across regions.

You may also incur additional charges for external data transfers or if you use Amazon API Gateway in conjunction with other AWS services (such as AWS Lambda).

Amazon SNS pricing is usage-based.

Standard topics

Once you deplete the free tier usage, the pricing is:

- $0.50 per million Amazon SNS requests 

- $0.50 per million mobile push notifications

- $2 per 100.000 email/JSON notifications

- $0.60 per million HTTP/s notifications

FIFO topics

Pricing is calculated based on the number of published messages, the number of subscribed messages, and payload data:

- publish requests are $0.30 per 1 million and $0.017 per GB of payload data

- subscription messages are $0.01 per 1 million and $0.001 per GB of payload data

Data transfer out of Amazon SNS is also charged. Pricing varies depending on the volume of data. For example, the first 1 GB per month is free, while the next 9.999 TB costs $0.09 per GB. 

Note that we have used US East (Ohio) as a reference point, but the pricing values differ across regions.

Enterprise package

What benefits do the Amazon API Gateway and Amazon SNS enterprise packages offer?

Explore Ably's enterprise package for our pub/sub messaging platform

There is no Amazon API Gateway-specific enterprise package.

There is no Amazon SNS-specific enterprise package.

Community

Reviewed by 3+ independent developers

Explore Ably's community support channel for our pub/sub messaging platform
4.50 / 5

Presence on multiple channels / 5

Size and activity / 5

“Among the AWS ecosystem, Amazon API Gateway seems to be one of the most popular products, which makes sense since it allows you to build your very own APIs. There are many GitHub repos created by the community, some of which have hundreds of stars. There are over 5000 questions on Stack Overflow under the aws-api-gateway tag, some of which have hundreds of thousands of views. It’s a big, active, and interested community.”

4 / 5

Presence on multiple channels / 5

Size and activity / 5

“The global AWS community is present on a multitude of platforms, ranging from Stack Overflow and GitHub to Medium, Discourse, and even Reddit. Of course, the SNS community is significantly smaller in size, but objectively speaking, still pretty big. To be more specific, there seem to be a lot of people interested in the product. If you look at the AWS SNS forum, you can see that some of the threads have even 20.000 or 30.000 views. Unfortunately, there seem to be a lot of questions without an answer. You can find some cool stuff on GitHub, such as an extended client library for Java that enables you to publish messages bigger than 256 KB.“

Support

What types of support options and response times do Amazon API Gateway and Amazon SNS offer?

Explore Ably's support options for our pub/sub messaging platform

General support options

Email, support ticket, phone, technical documentation, community support (e.g. forums or Stack Overflow). 

Enterprise support

Amazon offers an enterprise package, which includes 24/7 phone, email, and chat access to Cloud Support Engineers, Infrastructure Event Management support, and a designated technical account manager.

Response time

< 24 hours for general guidance queries

< 1 hour for Production system down incidents (only applies to Business & Enterprise support packages).

General support options

Email, support ticket, phone, technical documentation, community support (e.g. forums or Stack Overflow). 

Enterprise support

Amazon offers an enterprise package, which includes 24/7 phone, email, and chat access to Cloud Support Engineers, Infrastructure Event Management support, and a designated technical account manager.

Response time

< 24 hours for general guidance queries

< 1 hour for Production system down incidents (only applies to Business & Enterprise support packages).

Disclaimer: The information presented for Amazon API Gateway was last updated on 17 December 2020 and on 30 November 2020 for Amazon SNS. It is possible that some details may now be out of date. If you think that’s the case, please let us know so we can update them. In any case, you should not rely solely on the information presented here and must check with each provider before deciding to integrate or buy any of these two solutions.


View more comparisons