prisma & postgres v2
Hi there, wanted to migrate to v2 but a bit confused with these 2 variables to connect to my database with Prisma.
What are their differences?
DATABASE_URL
DATABASE_PRIVATE_URL
I have different 2 apps so I need to know which one to use to connect to my db:
1. Front-end that is deployed on vercel + my postgres db is on railway
2. Front-end in the same project as my postgres db on railway
Project ID: 22b04948-a71a-4235-a2be-4e0ecedceee8
Solution:Jump to solution
but to answer your questions directly
Front-end that is deployed on vercel + my postgres db is on railwayuse
DATABASE_URL
Front-end in the same project as my postgres db on railway...
7 Replies
Project ID:
22b04948-a71a-4235-a2be-4e0ecedceee8
Solution
but to answer your questions directly
Front-end that is deployed on vercel + my postgres db is on railwayuse
DATABASE_URL
Front-end in the same project as my postgres db on railwayuse
DATABASE_PRIVATE_URL
Thanks Brody, did some reading on the docs but a bit confused because I think I have read somewhere that egress can be cheaper if I use private url instead?
that is correct, although not just cheaper, you can eliminate all service to database egress costs by using the private network, but as the docs mention the private url can only be used for service to service (or database) communication within the same project
Cool! Thanks Brody for the explanation 🙂
no problem!