nestdotland / roadmap

Roadmap for Nest
2 stars 0 forks source link

Serverless Functions #5

Open maximousblk opened 4 years ago

maximousblk commented 4 years ago

Serverless Functions

Magic URL

Notes

What is this "Magic URL" you mention?

I don't know what else to call it (suggestions?). It is just a function that checks if the client is a browser and sends raw data or webpage accordingly. similar to what deno.land/x does.

Why Next.js API Routes and not Vercel Functions

Because Vercel Functions are "proprietary" and in case we ever need to migrate to some other platform, we would have to rebuild the functions for the platform we migrate to. Using Next.js would mean that the functions remain portable and can be run by any serverless platform (or even bare metal servers).

Then why Vercel at all? Why not run it on our own server?

Because with a great server comes great maintenance requirements 😛. If we choose to use a custom server we would have to:

The whole point of serverless is the is no one dedicated server. It's a cluster of many on-demand servers that run your code and scrap everything after that. Using Vercel save us from all of that headache and more.

Moreover, if you use Next.js, Vercel automatically pushes certain security patches. ref: GHSA-X56P-C8CG-Q435