Prisma-client-js: Investigate Amazon RDS Proxy

Created on 4 May 2020  路  11Comments  路  Source: prisma/prisma-client-js

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.

kindiscussion tectypescript

Most helpful comment

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.

All 11 comments

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.

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

@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.

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.

@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.

Your Cloud SQL instance needs a public IP.

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

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

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.

Awesome!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichalLytek picture MichalLytek  路  3Comments

Errorname picture Errorname  路  3Comments

esistgut picture esistgut  路  4Comments

FluorescentHallucinogen picture FluorescentHallucinogen  路  3Comments

divyenduz picture divyenduz  路  3Comments