Using Neon + Drizzle + Lambda
I am too confuse how to setup Neon + Drizzle + Lambda, I see alot of package that support every possible answer, but don't know which one is good one.
main goal is to run quick and efficient way in aws lambda.
I found nenodatbase/serverless and also drizzle have own drizzle-orm/neon-serverless.
1. Which connection URL should be pass pooled or normal one
2. using HTTP or websocket, which one is best fit
on lambda I will do CRUD simple process, but some time have to update multiple table at same time like using tranx.
Please reference or demo code link.
I am mostly using Prisma for ORM, how was it using prisma orm in serverless env, I found some bad review like it size, letancy in serverless env.
Thank
5 Replies
other-emerald•4mo ago
@Rishi Raj Jain any suggestions here?
xenial-black•4mo ago
Hey @Aung, check out this connection guide we put together: https://neon.com/docs/connect/choose-connection
Neon
Choosing your driver and connection type - Neon Docs
When setting up your application’s connection to your Neon Postgres database, you need to make two main choices The right driver for your deployment &8212; Neon Serverless driver or a TCP based driver...
xenial-black•4mo ago
There will always be trade-offs. For one-shot requests, we recommend http but then you won't be able to do transactions. You could use ws connections only for your transactions or use ws for all requests if you primarily use transactions.
xenial-black•4mo ago
Regarding ORM choice, all popular ORMs have plenty of docs around their recommended setup in serverless environments. Here is a good guide that documents how to use Neon's serverless driver with Prisma: https://neon.com/docs/guides/prisma
Neon
Connect from Prisma to Neon - Neon Docs
Prisma is an open source, next generation ORM that lets you to manage and interact with your database. This guide covers the following topics Connect to Neon from Prisma Use connection pooling with Pr...
eastern-cyanOP•4mo ago
thank @Daniel @Andre Landgraf , I will have a look on docs url