nextjs-mongodb-app icon indicating copy to clipboard operation
nextjs-mongodb-app copied to clipboard

Diference between Netlify and Vercel

Open joaogn opened this issue 4 years ago • 2 comments

I got a problem, when I deploy with the Netlify i need close the connection with the database, but when i use Vercel not need.

I noticed that at vercel, when I answer his request for everything, already at netlify if he has a callback he keeps running, so I need to close the bank.

Is this a problem at Netlify or just the way they work?

joaogn avatar Aug 22 '20 23:08 joaogn

Sorry for the late response. Vercel does this thing and set context.callbackWaitsForEmptyEventLoop to false as recommended in this article https://docs.atlas.mongodb.com/best-practices-connecting-to-aws-lambda/. I do not know if Netlify does such a thing, and if they do not, you may run into problems when using database in serverless environment.

hoangvvo avatar Sep 05 '20 18:09 hoangvvo

Are you using https://github.com/netlify/next-on-netlify? It may help to ask about context.callbackWaitsForEmptyEventLoop there.

hoangvvo avatar Sep 05 '20 18:09 hoangvvo