Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Investigate Amazon RDS Proxy #676

Closed
timsuchanek opened this issue May 4, 2020 · 11 comments
Closed

Investigate Amazon RDS Proxy #676

timsuchanek opened this issue May 4, 2020 · 11 comments
Assignees
Labels
kind/discussion Discussion is required. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@timsuchanek
Copy link
Contributor

RDS Proxy, which is in preview now has Postgres support https://aws.amazon.com/about-aws/whats-new/2020/04/amazon-rds-proxy-with-postgresql-compatibility-preview/

We should investigate if Prisma Client works with RDS Proxy.

@timsuchanek timsuchanek added kind/discussion Discussion is required. tech/typescript Issue for tech TypeScript. labels May 4, 2020
@timsuchanek timsuchanek added this to the Beta 5 milestone May 4, 2020
@janpio janpio modified the milestones: Beta 5, Beta 6 May 12, 2020
@dajinchu
Copy link

dajinchu commented May 13, 2020

I'm able to run prisma with RDS proxy.

Caveats:

  • Migrations don't work
  • Also: This might be out of scope, but running a lot of queries causes this error:
PrismaClientUnknownRequestError:
Invalid `prisma.product.findMany()` invocation in
/home/ubuntu/blitz-perftest/.blitz/caches/dev/.next/server/static/development/pages/api/test.js:131:79

Error in connector: Error creating a database connection.

For context, I'm running Prisma through a blitz.js app on EC2 in the same VPC as the RDS Proxy, with 100% of the 80 something max connections given to the proxy. I'm using this repo https://github.com/dajinchu/blitz-perftest/ I'm using artillery to send 20 req/s for 10 seconds. Using regular RDS w/o proxy at the same load does not cause this error.

@Sytten
Copy link

Sytten commented May 13, 2020

RDS proxy is fine, I just finished automated migrations on deploy on Cloud Build for a client.

@dajinchu
Copy link

@Sytten Would you mind elaborating on your setup? I'm not sure why mine isn't working. How are you accessing RDS Proxy from Cloud Build? I thought RDS Proxy only worked within the same VPC.

@Sytten
Copy link

Sytten commented May 14, 2020

You need a public IP to make it work because cloud build is not in the same vpc. This was fine with my client since the firewall denies all external connections except those from the proxy.

@janpio janpio changed the title Investigate RDS Proxy Investigate Amazon RDS Proxy May 14, 2020
@dajinchu
Copy link

@Sytten Hi, sorry I'm still struggling with this. Do you mean the RDS Proxy has a public IP or Cloud Build has a public IP? Thanks.

@Sytten
Copy link

Sytten commented May 21, 2020

Your Cloud SQL instance needs a public IP.

@dajinchu
Copy link

Ah ok, I think I may be thinking about AWS RDS and you are referring to GCP Cloud SQL?

@Sytten
Copy link

Sytten commented May 21, 2020

My bad, I probably misread the first time and thought about GCP since thats what I am currently working with.

@janpio janpio modified the milestones: Beta 6, Beta 7, Beta 8 May 26, 2020
@timsuchanek timsuchanek added the process/candidate Candidate for next Milestone. label Jun 10, 2020
@janpio janpio modified the milestones: Beta 10, 2.1.0 Jun 10, 2020
@janpio janpio removed the process/candidate Candidate for next Milestone. label Jun 11, 2020
@janpio janpio modified the milestones: 2.1.0, 2.2.0 Jun 25, 2020
@Jolg42 Jolg42 removed their assignment Jun 29, 2020
@janpio janpio self-assigned this Jul 4, 2020
@timsuchanek
Copy link
Contributor Author

We tested this from AWS Lambda and Prisma Client 2.2.2 and it works.
We will as a further task run our full test suite against it to make sure all edge cases are covered.

@Jolg42
Copy link
Contributor

Jolg42 commented Jul 31, 2020

Awesome!

@mcsdevv
Copy link

mcsdevv commented Sep 27, 2020

Hey @timsuchanek, what was the outcome of your full tests?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/discussion Discussion is required. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

No branches or pull requests

6 participants