Next.js Discord

Discord Forum

Connect Front With MongoDb in Real Time

Unanswered
Alapaha Blue Blood Bulldog posted this in #help-forum
Open in Discord
Alapaha Blue Blood BulldogOP
I have a Next.js Project that works with MongoDB Atlas, but I have all the connections with Axios requests, is there any way to have the connection in real-time with no need to make requests all the time?

Also, I am open to suggestions if you think there is a more compatible DB with NextJs that is more accessible and functional.

This is my Repo: https://github.com/LucianoCanziani/nextjs/tree/main

3 Replies

Yes, it’s Vercel Postgres, which connects Neon Postgres with Web sockets instead of http protocol. connection protocol is done in Neon side so it works in Edge Runtime.
one caveat, it’s RDB.
in general DB cloud services provide HTTP endpoints to allow users to connect from Serverless servers which cannot create connection pools
or host nextjs and db in the same vpn and use native protocol with connection pools