Live data from Hacker News

Netlify Edge Functions: A new serverless runtime powered by Deno

netlify.com

41–50 of 166 posts

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#41
post #13
post #6

Earlier quoted context omitted.

The first link in the article points to this: https://www.netlify.com/products/#netlify-edge-functions How to use them Drop JavaScript or TypeScript functions inside an edge-functions directory in your project. Use cases Custom authentication, personalize ads, localize content, intercept and transform requests, perform split tests, and more.

> Use cases > A bunch of server functionality Why is that the use case? I don't see how an edge function can be faster than a centralized server endpoint if it has to reach out to literally any other component of the system involved in auth / persistence

Even if it doesn't reduce latency, it could reduce bandwidth and load on other servers. (Or increase it, if it's used badly.)

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#42

Earlier quoted context omitted.

Is Netlify running Deno on their edge and not on Deno.com Deploy 's? Is this also what Slack, Vercel (?), and Supabase do?

Netlify and Supabase use Deno's infrastructure for code execution ( https://deno.com/deploy/subhosting ). Vercel hosts their edge functions on Cloudflare (nothing to do with Deno). Slack's Deno runtime is hosted on AWS.

Ok, I stay corrected.

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#43
post #38
post #36

I would love to jump over to something like Vercel or Netlify Edge, but maddeningly none of these platforms give you control over the cache key. I have pages that are server-side rendered with Cache-Control headers, but because our visitors come with unique tracking params on the end of their URL (e.g. from Mailchimp or Branch), we would essentially have no cache hits. It seems the only way to have control over this…

So far Netlify Edge Functions runs before the cache layer, so you can actually use a minimal function to rewrite the URL to remove all unique params, etc, and then let it pass through our system to a Netlify Function which runs behind our caching layer. For anything you can do at build time as a static HTML pages we already strip query parameters from cache keys.

Interesting, thanks... do you have any docs on how we might achieve this with Next.js? Am I right in thinking we would have essentially a custom Edge Function first that handles query params, and then a second Edge Function that renders the Next app?

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#44

Earlier quoted context omitted.

Is Netlify running Deno on their edge and not on Deno.com Deploy 's? Is this also what Slack, Vercel (?), and Supabase do?

Netlify and Supabase use Deno's infrastructure for code execution ( https://deno.com/deploy/subhosting ). Vercel hosts their edge functions on Cloudflare (nothing to do with Deno). Slack's Deno runtime is hosted on AWS.

Glad to see the Deno Company is getting a piece of the pie! Funding open source projects is tricky, but it seems like you're figuring it out.

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#46
Netlify pricing has always been confusing to me, but I'm not entirely sure why. I guess I'm more accustomed to pay-as-you-go in this space (CFW) than tiered plans (Netlify bundles their features into starter/pro/business).

It seems that the free plan is 3M invocations/mo, starter is 15M/mo, and business is 150M/mo, but there aren't any ways to increase those limits (business says to contact them for higher limits).

Personally I'd prefer true pay-as-you-go without hard limits, even if it's a bit more expensive. To me the point is to sign-up-and-forget-it without having to worry if I'm within those limitations.

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#47

This is a new concept for me, what is the use case for edge functions?

For one (minor) thing, they're a great way to add certain HTTP headers which can't be handled through other means. I use a Cloudflare Worker to give my site the necessary headers for its Content Security Policy (some parts of which aren't to be added via a tag[0]), as well as the nonces[1] for that CSP. This only scratches the surface, of course.

[0]: https://content-security-policy.com/examples/meta/

[1]: https://content-security-policy.com/nonce/

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#48
post #5

This is great news. I'm really rooting for a successful trend of Serverless runtimes, mainly as a weapon against rising cloud deployment costs. While the general trend today is to back the serverless environment with Javascript runtimes (Cloudflare runs its edge on top of V8, Netlify uses deno, most other serverless runtimes use nodejs), I'm optimistic that WebAssembly will take over this space eventually, for a bunc…

> mainly as a weapon against rising cloud deployment costs. Cloud Functions is literally code you're running in the cloud. And the moment you approach their limit(ation)s, you will see the same "rising cloud deployment costs" > Running a WASM engine on the cloud means ... a fraction of the overhead of a container or nodejs environment You do realise that there are other languages than javascript in nodejs? That there…

I sought to unserstand "serverless" but every deployment diagram I have ever seen show things that look an aweful lot like they run on... servers?

Maybe I don't get the idea (and honestly I was too lazy to put in the legwork), but when I hear something like "serverless" I imagine some p2p javascript federated decentralized beast where the shared state is stored through magic and tricks with the users clients and there is literally no server anywhere to be found.

Instead it seems like a buzzword (?) for a weirdly niche way of running things that someone with a 4 Euro/Month nginx instance that hosts 10 websites will probably never understand.

Maybe I also don't need to understand because I know how to leverage static content, caching, fast Rust reverse proxy services and client side javascript to develope fast web stuff that gets the job done).

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#49
post #23

Earlier quoted context omitted.

Looks like it comes with Typescript support

Anything running JS comes with some TS support, you just have to transpile it before releasing :) I'm not sure why shipping the transpiler on the production server rather than keeping it in your CI is a good idea, but I think that's what Deno is doing.

True, but one feature I enjoy about Cloudflare workers is that I just edit them in the browser, even on devices without nodejs installed.

Re: Netlify Edge Functions: A new serverless runtime powered by Deno

#50
post #34
post #2

Aaron from Deno here, happy to answer any questions you may have !

How many Deno instances might an edge server run? Does each tenant have an instance or is there multi-tenancy? What interesting tweaks have you made making a cloudified offering of Deno tailored for http serving?

We're building a highly multi-tenant "isolate cloud" (think VMs => containers => isolates, as compute primitives).

The isolate hypervisor at the core of our cloud platform is built on parts of Deno CLI (since it has a modular design), but each isolate isn't an instance of Deno CLI running in some kind of container.

Isolate clouds/hypervisors are less generic and thus flexible than containers, but that specialization allows novel integration and high density/efficiency.

Post reply on HN