4 ms·
(Netlify engineer here) To echo what the others have said, lambdas are a bit smarter than that. They actually keep the node process running until it has been id
by ascorbic 4y ago
(Netlify engineer here) To echo what the others have said, lambdas are a bit smarter than that. They actually keep the node process running until it has been idle for around 5-15 minutes. We can make use of that ourselves by reusing the Next server too. We even cache data locally in the lambda tmpdir (though we do that more for Gatsby). The cold start issue though is one of the reasons that using isolates rather than Node-based functions is so great. Both Cloudflare Workers (used by Vercel) and Deno Deploy (used by Netlify) have extremely fast starts, even when cold.
It's generally just a better fit for this model, which is why I'm so glad to see the approach becoming more popular and am genuinely please that Vercel's offering has gone GA. The more this model of edge computing spreads, the better. More framworks will add support, and it will be a virtuous cycle. The WinterCG work on creating a common standard for these runtimes is also a great project.
- lagrange77 4y agoRead up on isolates. Really interesting stuff! It indeed seems to be a better and more natural fit for something like SSR route handlers, as far as i understand it. > More framworks will add support, and it will be a virtuous cycle. I'm in the early phase of developing a SSG in (TypeScript) Node currently. I think i'll study isolates and Deno a bit more, before going further. :)
- itisit 4y agoV8 Isolates aren't exactly new (been around for about a decade); I'm sure the good folks at Netlify are up to speed on them. :) Containers were clearly the safer bet when FaaS options hit the scene 6-8 years ago. Now with WASM opening up possibilities, Cloudflare made the smart move to base their edge compute off isolates, given the significantly reduced overhead. Will be fun to see how the cloud competition responds!
- ascorbic 4y agoI think they meant "I read up on isolates", rather than "You should read up on isolates"! I think you're exactly right though. Isolates are the way forward, and are gradually going to take more and more use cases from node-based functions.
- lagrange77 4y agoRight, that's what i meant.
- ascorbic 4y agoTake a look at our docs on integrating with Netlify Edge Functions. They're mainly aimed at framework developers. https://docs.netlify.com/netlify-labs/experimental-features/edge-functions/create-integration/ https://docs.netlify.com/netlify-labs/experimental-features/...
- lagrange77 4y agoThank you!
- jenius 4y agoVercel has edge function support as well that will work with any framework, docs are here: https://vercel.com/docs/build-output-api/v3#vercel-primitives/edge-functions https://vercel.com/docs/build-output-api/v3#vercel-primitive...
- lagrange77 4y agoThank You, too!