Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Aurora PostgreSQL be used with AWS AppSync?

I've seen examples of DynamoDB as the data source for AWS AppSync but I'm wondering if Aurora (specifically PostgreSQL) can be used? If yes, what would the resolvers look like for a basic example? Are there any resources that demonstrate doing this for Aurora PostgreSQL or even MySQL?

like image 697
user1843640 Avatar asked Jan 30 '18 03:01

user1843640


People also ask

Is AWS Aurora compatible with Postgres?

Amazon Aurora PostgreSQL is a fully managed, PostgreSQL–compatible, and ACID–compliant relational database engine that combines the speed, reliability, and manageability of Amazon Aurora with the simplicity and cost-effectiveness of open-source databases.

Which database is Amazon Aurora compatible with?

Amazon Aurora (Aurora) is a fully managed relational database engine that's compatible with MySQL and PostgreSQL.

Does AppSync work with RDS?

Since AppSync integrates with AWS Lambda, RDS, and DynamoDB, chances are you won't need to write custom code to connect to your databases.

What is difference between PostgreSQL and Aurora?

AWS only claims Aurora Postgres as a PostgreSQL compatible database. The biggest difference is that PostgreSQL is an Open Source database software with over 30 years of active development. The development, patches, bugs, discussions and ideas are all open to the World.


2 Answers

It can not. You can use Aurora Serverless as the data source which is driven by Data API (still in beta), this allows you to configure resolvers as database queries. That being said Data API is still very slow and Aurora Serverless has a cold-start of 30sec or so as it needs to run from VPC. I would recommend avoiding production but worth playing around.

You are much better of using Lambdas as resolvers or running HTTP RestFul calls from within the resolvers.

Ignore the comments provided in the answer, no disrespect, but the comments are coming from people who never managed production at scale. The fact you have a fully manage GraphQL service at scale as well as with high-security posture will save you months of maintenance nightmares when your product(s) will reach anything close to 1MIL revenue.

like image 113
rock3t Avatar answered Oct 21 '22 04:10

rock3t


You can use the AWS Lambda resolver available in AWS AppSync to access Aurora Postgres. The code is similar to how you would access a relational database using any language. For example, you could use node-postgres with NodeJS to implement the Lambda function.

like image 40
Rohan Deshpande Avatar answered Oct 21 '22 04:10

Rohan Deshpande