Maddy26
Maddy26

Reputation: 107

How to publish AWS SNS data to MySql database

I am new to AWS/Database. Since i am completely beginner to this, any suggestions will be appreciated.
Currently in the project it has been planned like data from AWS database will be pushed using SNS HTTP fanout to external MySql Database.
NOTE :
1.The data will be pushed by the Client using AWS SNS
2. We have no access to the AWS account nor we are planning to have a AWS account.
3. External MySql database is a private database running on Linux Server
I have gone through the Official documentation of AWS SNS, and also some websites. This is all i found :

  1. Use external applications like Zapier to map the data.

  2. Develop some application to map the data.

    Is it like using a Servlet application in the receiver side to update the table, or is there any other methods?

    AWS DB -----> SNS -----> _________ -----> External MySql DB

Thanks

Upvotes: 0

Views: 1724

Answers (2)

Sarthak Jain
Sarthak Jain

Reputation: 2096

If you cannot have an AWS Account, you can have your own web server consume the SNS Messages. SNS can deliver messages to an HTTP/HTTPS endpoint in a predefined structure. Read more details here. You can enable such an endpoint on your own server and share your server URL with the AWS Account owner. They can create a subscription from their SNS topic to your endpoint.

For setting up this endpoint, there are many options. ExpressJS is one such popular framework to quickly implement HTTP APIs.

Upvotes: 3

Marcin
Marcin

Reputation: 238687

Probably, option two would be more suited, or at least first to be considered. For that option you would have have to develop a lambda function which would receive data from SNS, re-format if needed and upload it to MySQL. So your architecture would look like:

Data--->SNS--->Lambda function---> MySQL

Depending on the amount of incoming data to the SNS, you may add SQS queue as well to the mix, to buffer the records and enable fun-out architecture. For example:

               /---> SQS queue 1---> Lambda function 1---> MySQL
Data -->SNS --/ 
              \
               \--- SQS queue 2 ---> Lambda function 2, EC2 instance, Container ---> Other destination  

Other solutions are possible. But I would first consider the above, before looking into other ways.

Upvotes: 1

Related Questions