aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

[Feature Request] Support RDS Proxy as an AppSync data source #270

Open vicary opened 1 year ago

vicary commented 1 year ago

We have multiple production API deployments, having ~500 Lambda resolvers on average.

  1. Most of the 500 functions are thin resolvers, only for the purpose of interacting with RDS Proxy with an Aurora Serverless V2 cluster behind it. It adds significant latency overhead because of Lambda cold starts, with our Node.js TypeScript stack it increases response time with ~1.4s.
  2. Some of our older deployments use Aurora Serverless V1, they are constantly impacted by the slower scaling window, resulting in "Too Many Connections" error.

These problems would be solved if AWS AppSync supports RDS Proxy as a datasource out of the box, without having to go through Lambda.

onlybakam commented 1 year ago

are you available to talk? would love to learn more. you can DM me on twitter (@bricepelle)

vicary commented 1 year ago

@onlybakam Twitter doesn't let me, we can email at vicary@august.com.hk if that helps.

image
jbschooley commented 1 year ago

We are looking at migrating a good chunk of our database to relational because it fits our needs better, but AppSync's lack of support for RDS other than the now-deprecated Serverless V1 is holding us back.

We've considered using Lambda thin resolvers, but we'd run into the same issues with cold start delays. We would also run into cost issues with the scaling we're expecting. A possible solution to that is using EC2/ECS/EKS/Fargate for that layer--but that introduces security issues because AppSync's HTTP resolver can't access resources in a private subnet.

The best solution would be if RDS Proxy (or a direct RDS connection for dev environments that won't run into scaling issues) could be used as a data source in AppSync. As long as variableMap builds prepared statements instead of concatenating, because SQL injection is bad. I'd be up for a chat too.