T3 is severless, yet uses prisma— how...?
Still confused about how database connections work from short-lived workers.
Is https://prisma.io/docs/data-platform/data-proxy the only way?
Say you have a t3 fullstack vercel app and a railway DB. You don't just plug the DB url into prisma client, do you?
27 Replies
you can
if you do very occasional requests for the lambda
you will have coldstarts
this could potentially run out of db connections at scale?
that kind of thing is on the dbside of things
no longer t3
if amount of lambadas > greater than db can support
but yeah, can happen
connection pools is a issue related to the database
so how do people resolve that in the real world
ive only seen prisma data proxy address that
increasing the pool
huh
Shoubhit Dash
Typesafe Database Queries on the Edge
Edge computing is all the rage. Learn how to get typesafe access to data on the edge using Kysely, Prisma and PlanetScale.
as a example
you can use planetscale serverless driver
ah rest api
so you dont need to create a new connection on every new lambda container
right
btw, prisma data proxy is awful
how so?
slow
ah. that sucks
seemed like the holy grail to my inexperienced eyes going serverless
if you really want
you have serverless databases as well
planetscale for mysql
cockroachdb for postgres
you can have distributed systems
but you are confusing lambdas and edge funcions
you're right, I am
edge would be cloudflare, lamba would be vercel nope edge too
vercel serverless run on aws lambdas
vercel have edge functions, but its a different product
ah, well thanks for the numerous corrections in my understanding, you answered the questions I didn't know how to ask lol
np
Fireship
YouTube
Is "edge" computing really faster?
Edge computing is becoming a popular way to deliver modern web applications. Let’s find out if the Edge is really faster by comparing Firebase to Vercel Edge Functions with Next.js.
#webdevelopment #javascript #vs
🔗 Resources Next Firebase Course https://fireship.io/courses/react-next-firebase/ Next.js 12.2 Release https://nextjs.org/blog/...
🔗 Resources Next Firebase Course https://fireship.io/courses/react-next-firebase/ Next.js 12.2 Release https://nextjs.org/blog/...
if using a serverless client / data api is not an option, either because target db doesn't support it OR because its serverless client / data api don't support some crucial characteristic (e.g. no transaction support)..
you can limit concurrent lambda invocations with reserved concurrency OR distribute to N groups in SQS FIFO.
can also offload to custom built batch job or dump to s3 (some databases support s3 ingest).
that's off the top of my head...
very cool to hear those new potential solutions, haven't thought about engineering database integration like that, thx!