Live data from Hacker News

Vercel Serverless Functions vs. Cloudflare Workers

moiva.io

1–10 of 37 posts

Re: Vercel Serverless Functions vs. Cloudflare Workers

#2
Can someone knowledgeable please explain where these workers are useful?

Serverless components within an main infa. make sense - it's an easier way to deploy.

But these 'edge' functions ... what is the advantage of saving a few ms on a transaction?

I understand that we may want standard content pushed out to the edge, but in what situation is it really worth all the added complexity of risk of pushing out functions to the edge, to save a few ms?

Re: Vercel Serverless Functions vs. Cloudflare Workers

#3
Wow this was extremely informative for me! Cleared up a cacheing concern I had. Thanks for sharing.

I've had good success using the free tier of Vercel functions to handle the low-traffic storefront and user accounts for offsetra.com - Just wrapper functions around stripe and firestore. It's a godsend for independent, unskilled, time-constrained front-end devs like me!

Re: Vercel Serverless Functions vs. Cloudflare Workers

#4
post #2

Can someone knowledgeable please explain where these workers are useful? Serverless components within an main infa. make sense - it's an easier way to deploy. But these 'edge' functions ... what is the advantage of saving a few ms on a transaction? I understand that we may want standard content pushed out to the edge, but in what situation is it really worth all the added complexity of risk of pushing out functions t…

> in what situation is it really worth all the added complexity of risk of pushing out functions to the edge

If you are talking about developer point of view, then there is no additional complexity. All the complexity is covered by the underlying platform

> what is the advantage of saving a few ms on a transaction?

one example - if a transaction consists of a few separate sequential transactions, then ms add up and might affect user experience. Also an app might need to issue lots of requests on a page load and taken that there is a limit on parallel requests (6 requests per domain), the advantage might be sensible.

Having said that, I tend to agree that many use cases are not sensible to a few ms advantage

Re: Vercel Serverless Functions vs. Cloudflare Workers

#5

Wow this was extremely informative for me! Cleared up a cacheing concern I had. Thanks for sharing. I've had good success using the free tier of Vercel functions to handle the low-traffic storefront and user accounts for offsetra.com - Just wrapper functions around stripe and firestore. It's a godsend for independent, unskilled, time-constrained front-end devs like me!

Thanks for feedback! Caching... it took me time to get my head around it. With Vercel it works more or less the way I imagined. It surprised me that Cloudflare has a different approach. But once I got it, it started making sense and I like it :)

Good luck with your project!

Re: Vercel Serverless Functions vs. Cloudflare Workers

#6
post #2

Can someone knowledgeable please explain where these workers are useful? Serverless components within an main infa. make sense - it's an easier way to deploy. But these 'edge' functions ... what is the advantage of saving a few ms on a transaction? I understand that we may want standard content pushed out to the edge, but in what situation is it really worth all the added complexity of risk of pushing out functions t…

> in what situation is it really worth all the added complexity of risk of pushing out functions to the edge If you are talking about developer point of view, then there is no additional complexity. All the complexity is covered by the underlying platform > what is the advantage of saving a few ms on a transaction? one example - if a transaction consists of a few separate sequential transactions, then ms add up and m…

[deleted]

Re: Vercel Serverless Functions vs. Cloudflare Workers

#7
post #2

Can someone knowledgeable please explain where these workers are useful? Serverless components within an main infa. make sense - it's an easier way to deploy. But these 'edge' functions ... what is the advantage of saving a few ms on a transaction? I understand that we may want standard content pushed out to the edge, but in what situation is it really worth all the added complexity of risk of pushing out functions t…

One use case is validating auth tokens at the edge so you can edge cache API responses that require auth.

Re: Vercel Serverless Functions vs. Cloudflare Workers

#8
Great post, enjoyed your writing style and drawings a ton!

One of the bigger things I think Workers have going for it versus others is it’s ability to bind WASM modules. Hyper efficient, basically native running computation at edge is a really cool concept. Especially since you can talk to it with a dead-simple JavaScript API.

For example, Cloudflare charges a good amount of money for image resizing using their CDN however they do it. At the same time, they also have this proof of concept worker that uses Web Assembly to do it for basically free! [1]

Another cool demo that was on HN the other day was embedding SQLite with WASM for edge quick transactions. [2]

Completely mind blowing... Still, very few demos in the wild. The learning curve is a beast and hopefully gets better as Rust and WASM become more mainstream for web developers.

[1] https://github.com/cloudflare/cloudflare-workers-wasm-demo

[2] https://github.com/lspgn/edge-sql

Re: Vercel Serverless Functions vs. Cloudflare Workers

#9

Wow this was extremely informative for me! Cleared up a cacheing concern I had. Thanks for sharing. I've had good success using the free tier of Vercel functions to handle the low-traffic storefront and user accounts for offsetra.com - Just wrapper functions around stripe and firestore. It's a godsend for independent, unskilled, time-constrained front-end devs like me!

One important piece missing from this article is that on Vercel you do not get global Serverless functions on any plan except the Enterprise plans. By default you can pick one preferred region for your Serverless functions and that's the region that's always used. In practice, assuming you have a somewhat decent caching strategy, this doesn't really matter as far as latency is concerned. Where it could potentially matter is that AWS region having an outage and now you can't fallback to another. We deploy all our functions to at least two regions and Vercel does handle region failover in this case.

Disclaimer: I'm a Vercel enterprise customer

Re: Vercel Serverless Functions vs. Cloudflare Workers

#10
I had been using Vercel for a Next.js SSR deployment up until this week when I moved it to a basic AWS Lightsail box with no real NGINX optimisations.

I have Lightsail server in Frankfurt and I am in Sydney and the Lightsail box gets a higher Pagespeed score than the Vercel deployment and from my own anecdotal usage, the page load is noticeably faster. I had Vercel region set to Paris (no Frankfurt region yet).

I loved the simplicity of Vercel, especially the per-branch-deployments (which Im still using on the free tier) but it was surprising that for all the serverless boasts, its not actually any faster than a basic server.

Post reply on HN