Reusing db connection in lambda with Drizzle
I'm using rds mysql community as my DB and have been running into a connection limit problem when using server actions in Nextjs with prisma to interact with it(first image is the number of connections when I was burst testing), after searching a bit through the sst discord saw that someone recommended drizzle for better perfomance. When I looked through their docs I saw they mentioned a way to reuse the db connection: https://orm.drizzle.team/docs/perf-serverless
But through their example I found it hard to understand how it's being shared and if that would help with my connection limit problem
My connection looks like this:
And this is an example server action
Is there anything else I need to do so it can reuse the connection? Because just letting it like this isn't really working as you can see in the second image.
But through their example I found it hard to understand how it's being shared and if that would help with my connection limit problem
My connection looks like this:
And this is an example server action
Is there anything else I need to do so it can reuse the connection? Because just letting it like this isn't really working as you can see in the second image.


Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
