Hello everyone! quick question.. I am working on a...
# orm-help
e
Hello everyone! quick question.. I am working on a project using serverless functions. I’ve been reading about the potential connection pooling issue. The mitigation I read was about using pgBouncer (for Postgres). If using AWS Aurora serverless, does this issue go away/be mitigated OR there would be the same issue with connection pooling? (we don’t want the db exposed to public internet)
n
Hey 👋 If you are referring to AWS Aurora Serverless V2 (preview) then you could either use AWS RDS Proxy along with it to mitigate the connection pooling Issue or you could use an external pooler like PgBouncer as well.
e
@Nurul Thanks for the response! a couple of related questions.. 1. From https://www.prisma.io/docs/guides/deployment/deployment-guides/caveats-when-deploying-to-aws-platforms#aws-rds-proxy, I see that we won’t get any benefits of using RDS proxy when used with Prisma?
Because Prisma uses prepared statements for all queries, you won’t see any benefit when using RDS Proxy with Prisma.
2. (More of Aurora serverless newbie question) If there is no connection pooling in front of Aurora serverless, the database would scale up when there are lots of serverless functions spawned then ultimately scale down slowly and basically you’d be wasting resources? 3. Do you by any chance a good example (like an article) of running PgBouncer in AWS? Thanks!
n
That’s true you won’t get much benefit when using AWS RDS Proxy, Actually, Aurora Serverless V2 just went into General Availability(GA) last week so there aren’t many resources for it yet. I am not sure if you would run into connection pooling issues often or not, they seem to scale up and down as per your traffic and it also depends on your use case This AWS article might help you in deciding if your use case fits https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html
e
@Nurul thanks, I will look into those and test if possible with Aurora Serverless v2.
👍 1