Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless Functions #5

Open
maximousblk opened this issue Oct 9, 2020 · 0 comments
Open

Serverless Functions #5

maximousblk opened this issue Oct 9, 2020 · 0 comments
Assignees

Comments

@maximousblk
Copy link
Member

maximousblk commented Oct 9, 2020

Serverless Functions

Magic URL

  • Same URL for web and import
  • Handle X-Deno-* headers
  • Proxy arweave and cache data on Vercel

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:

  • Set up and maintain SSL
  • Setup auto-deployment for all the branches and create a companion GitHub bot for it
  • Configure CDNs to properly cache requests
  • Set up load balancers and other (D)DOS protection
  • Deal with extra bandwidth costs in case of increased usage
  • And all of the above while paying for each of them in time and man-power in addition to money

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

@maximousblk maximousblk moved this to In Dev in rewrite Oct 13, 2021
@maximousblk maximousblk self-assigned this Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Dev
Development

No branches or pull requests

1 participant