?>

MongoDB + Amazon SNS Integrations

Appy Pie Connect allows you to automate multiple workflows between MongoDB and Amazon SNS

  • No code
  • No Credit Card
  • Lightning Fast Setup
About MongoDB

MongoDB is an open-source document-based database management tool that stores data in JSON-like formats. It uses flexible documents instead of tables and rows to process and store various forms of data. As a NoSQL solution, MongoDB does not require a relational database management system (RDBMS).

About Amazon SNS

The Amazon SNS platform (SNS) is a web service that enables you to send an SMS or a text-enabled mobile push notification to targeted subscribers.

Amazon SNS Integrations

Best ways to Integrate MongoDB + Amazon SNS

  • MongoDB Amazon SNS

    MongoDB + Amazon SNS

    Create Message to Amazon SNS from New Document in MongoDB Read More...
    Close
    When this happens...
    MongoDB New Document
     
    Then do this...
    Amazon SNS Create Message
  • MongoDB Amazon SNS

    MongoDB + Amazon SNS

    Create Topic to Amazon SNS from New Document in MongoDB Read More...
    Close
    When this happens...
    MongoDB New Document
     
    Then do this...
    Amazon SNS Create Topic
  • MongoDB Amazon SNS

    MongoDB + Amazon SNS

    Create Message to Amazon SNS from New Field in MongoDB Read More...
    Close
    When this happens...
    MongoDB New Field
     
    Then do this...
    Amazon SNS Create Message
  • MongoDB Amazon SNS

    MongoDB + Amazon SNS

    Create Topic to Amazon SNS from New Field in MongoDB Read More...
    Close
    When this happens...
    MongoDB New Field
     
    Then do this...
    Amazon SNS Create Topic
  • MongoDB Amazon SNS

    MongoDB + Amazon SNS

    Create Message to Amazon SNS from New Database in MongoDB Read More...
    Close
    When this happens...
    MongoDB New Database
     
    Then do this...
    Amazon SNS Create Message
  • MongoDB {{item.actionAppName}}

    MongoDB + {{item.actionAppName}}

    {{item.message}} Read More...
    Close
    When this happens...
    {{item.triggerAppName}} {{item.triggerTitle}}
     
    Then do this...
    {{item.actionAppName}} {{item.actionTitle}}
Connect MongoDB + Amazon SNS in easier way

It's easy to connect MongoDB + Amazon SNS without coding knowledge. Start creating your own business flow.

    Triggers
  • New Collection

    Triggers when you add a new collection.

  • New Database

    Triggers when you add a new database.

  • New Document

    Triggers when you add a new document to a collection.

  • New Field

    Triggers when you add a new field to a collection.

  • New Subscription

    Triggers when you add a new subscription.

  • New Topic

    Triggers when you add a new topic.

    Actions
  • Create Document

    Create a new document in a collection of your choice.

  • Create Message

    Create a new message.

  • Create Topic

    Create a new topic.

How MongoDB & Amazon SNS Integrations Work

  1. Step 1: Choose MongoDB as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick Amazon SNS as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from MongoDB to Amazon SNS.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of MongoDB and Amazon SNS

Introduction:

In this article I will discuss the integration of MongoDB and Amazon SNS.

MongoDB?

MongoDB (from humongous. is an open-source, document-oriented database. It is written in C++. MongoDB is developed by 10gen, a New York-based startup company. MongoDB stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time.

MongoDB is schemaless and offers high performance, high availability, and automatic scaling. And it has a rich driver ecosystem.

Amazon SNS?

Amazon Simple Notification Service (Amazon SNS. is a cloud computing web service that enables you to send push notifications to mobile devices, email addresses, and landline phones via SMS/voice calls. Amazon SNS delivers notifications using Amazon Simple Queue Service (Amazon SQS. It is also available on other notification channels, such as the Amazon CloudWatch Events conspe, AWS Lambda conspe, or custom HTTP/REST endpoints.

Why do we need to integrate MongoDB with Amazon SNS? People are using Amazon SNS for sending texts messages, emails and phone calls to their customers. In addition, Amazon SNS allows us to send notifications to mobile applications like Facebook, Twitter and many others. It has a simple API that makes it very easy to use.

To get started with a new application using Amazon SNS, we need to go to https://aws.amazon.com/sns/ and click “Create New Topic” button. After clicking the button, the user must fill the required fields (such as Topic Display Name. and select one region from the provided list (these regions are available in all AWS regions – US West 1, EU West 1, US East 1, US East 2, EU West 2, Asia Pacific South East 1. Then he needs to provide a topic name (this name will be used later when we want to send notifications), then he needs to provide a notification method (in this case I chose SMS), and after that he needs to provide a topic ARN (Amazon Resource Name. This ARN is similar to a DNS Record in DNS terminpogy – it is the unique identifier for the topic itself. A short example of it looks like this. arn:aws:sns:us-east-1:123456789012:TopicName. After providing all these information the user will be able to subscribe and publish notifications. The whpe process of creating a topic took me around 4 minutes.

Also, I would like to inform you that currently there are two types of topics available – standard and premium. In standard topics maximum number of messages is less than 50 messages per day. Premium topics have no limits for sending messages per day. In addition, premium topics allow you to subscribe to URLs from your website or web app. So basically it allows you to send notifications to your website visitors directly without them opening any application or clicking any link. This feature is very handy in my opinion because it helps you save time of your website visitors and increase CTR (click through rate. Also, it is important to mention that Amazon SNS sends notifications only when they are sent via Amazon SNS – if you send them directly it will not work properly. So in order to get full functionality we should use Amazon SNS only.

Now that we have created a topic lets create an application that will use this topic for sending messages. To get started with the integration we need to create a new app in web conspe at https://conspe.aws.amazon.com/sns/welcome/. After creating a new app we need to configure it by providing two pieces of information:

AWS account ID where our application will be running (you can find this value on dashboard of your account); Topic ARN that we have created earlier for our topic;

After providing these values we should click “Test” button and wait until test is finished successfully. Also we should leave “Topic ARN” field blank until we complete programming part of our application. After clicking on “Test” button it took me around 3 minutes to finish testing procedure and receive confirmation email from Amazon SNS that everything works properly. After getting confirmation email I was able to start programming my application by sending notifications from my app. But before doing that I would like to discuss how we can program our application for sending notifications through Amazon SNS. First thing we need to do is create an instance of Amazon Simple Notification Service Client using Node JS http library called request or superagent (it depends on which library you prefer. After creating client object we need to provide three parameters during initialization – aws credentials, region where you want to send notifications and topic ARN from our previous step (when creating our client. Next step consists of preparing JSON message with fields that we would like to include into a message – title, content, and image_url (if you want to add image_url into message you must provide base64 encoding of the image file. After preparing message object we can finally send message using post function of our client object and providing parameter named MessageBody . Here is an example code:

var amazonSNS = require('amazonsns'); var url = new URL(process.env[process.env.AWS_ACCESS_KEY_ID]); var creds = url && url.href ? url . null; var client = new amazonSNS({ region. process.env[process.env.AWS_REGION], accessKeyId. creds ? creds . process.env[process.env.AWS_ACCESS_KEY_ID], secretAccessKey. creds ? creds . process.env[process.env.AWS_SECRET_ACCESS_KEY], }); var message = { 'MessageBody'. { 'Title'. 'This is title', 'ContentType'. 'Text', 'Content'. 'Some content.' }, 'ImageUrl'. 'http://example.com/image_file', }; client .post('TopicArn'. .set(message. .execute(. .then(function(. { conspe.log('Successfully sent message with id ', message['ResourceId']); }. .catch(function(err. { conspe.log('Error while sending message. ', err); });

After executing our code we should receive confirmation email with unique message ID assigned by Amazon SNS for each message sent by our application through Amazon SNS – if we don’t receive confirmation email then something went wrong with our application or some settings of our app were incorrect so we should check them again and try again until everything works properly (I had some problems with my code because I didn’t know about GIT so I used my local browser cache instead of downloading files from GIT when I pushed new files but luckily I found out about it pretty quickly. If everything works fine we should be able to see email containing message ID in our mailbox 😎 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉 ! 😎 ! 🎉!😎!🎉!😎!🎉!😎!🎉!😎!🎉!😎!🎉!😄!🎉!😄!🎉!😄!🎉!😄!🐻!🐻!🐻!🐻!. Congratulations guys 💪🏻💪🏻💪🏻💪🏻 !! You’ve successfully integrated MongoDB with Amazon SNS! Now you’re ready to go further with your programming experience :. !!!

The process to integrate MongoDB and Amazon SNS may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.