Live data from Hacker News

Netlify Edge Functions: A new serverless runtime powered by Deno

netlify.com

51–60 of 166 posts

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

#51

big-time red flag that they're using deno's infra... wouldn't trust that

It sounds like Netlify is essentially reselling a third-party service here. Isn't operating infrastructure Netlify's job? Why outsource this? Can requests end up taking circuitous paths where Netlify and Deno's infra don't line up?

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

#52
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.

> 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.

IMHO, the decoupling of build step and runtime step in JavaScript was a terrible mistake. I've wasted hours just trying to find tsconfig settings that are compatible with the other parts I'm using. Shipping a transpiler with a known-good configuration alongside the runtime forces everyone to write their packages in a way that are compatible with that configuration, instead of creating a wild west.

The current state of modules and npm reminds me a bit of the bad old ”php.ini” days, where you would have to make sure you enabled the language features enabled by the code you wanted to import. What a mess.

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

#53

Earlier quoted context omitted.

> a fraction of the overhead of a container I mean, only in theory or when looking at it from the right angle, right? Or are you only comparing against JavaScript (unclear)? WASM is still much slower than native code. Containers spend most of their time executing native code; the "overhead" of containers is at the boundaries and is minor compared to the slowdown by moving from native code to WASM. In the future WASM…

Edge functions are typically run intermittently, with their runtime stopped to free up resources between runs. Therefore a big factor is startup and shutdown speed. Containers are pretty bad there. Deno is better, and WASM is unbeatable, especially with things like Wizer[0]. [0] https://github.com/bytecodealliance/wizer

Makes sense when talking about edge functions, but then OP started talking about Kubernetes. Our Kubernetes workloads don't resemble that at all; there's virtually none of that container startup/shutdown overhead to be concerned about. Most weeks, no containers are started or stopped at all.

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

#54

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

You have a hosted static web app but want to dynamically change the tags in your index.html to provide a unique url preview for each route (/about, /careers, etc)

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

#55
post #43
post #38

Earlier quoted context omitted.

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?

I work at Netlify on framework integrations. Next has beta support for running the whole app at the edge, and Netlify supports that. If you create you own custom edge functions they will run first, so you can do just that. You can also run Next "normally" (i.e. in the node-based Netlify Functions) and run your own edge functions in front of that. In those you can modify the Request in any way you'd like, before passing it on to the origin.

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

#56
post #16
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…

I agree about WASM. I am sort of worried that Deno may be too late tbh. Why would I bother with an interpreted language at all when I can code in any language I want and run it anywhere with WASM?

What is "any language" these days? I feel like WebAssembly's day will come when one of those is Javascript, and so far that hasn't happened.

Go's support is pretty good (with tinygo offering a tiny runtime more suited to this application). Rust appears to support compiling directly to WebAssembly, and there are some smaller languages like AssemblyScript and Lua with support. I'm guessing plain C works fine. Then there are projects that compile the runtime for interpreted languages to WebAssembly, so you can theoretically run things like Python.

Nobody is writing applications in C or AssemblyScript, so that leaves rust or go. If you're using one of those languages, though, you can just (cross-)compile a binary and copy it to a VM that is on some cloud provider's free tier, so this isn't really easing any deployment woes. It was already as easy with native code, so WebAssembly isn't adding much stuff here. (The isolation aspect was interesting in the days before Firecracker, but now every computer has hardware virtualization extensions and so you can safely run untrusted native code in a VM at native speeds.)

Anyway, I always wanted WebAssembly for two things: 1) To compile my React apps to a single binary. 2) To use as a plugin system for third-party apps (so I don't have to recompile Nginx to have OpenTracing support, for example). The language support hasn't really enabled either, so I'm a little disappointed. (Disappointed isn't really fair. I've invested no effort in this, and I can't be disappointed that someone didn't make a really complicated thing for me for free. But you know what I mean.)

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

#57
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…

> There must be a better way?

You're experiencing friction trying to use something in a way that it's supposed to not be used. (I.e., click-tracking by junking up URLs.) You could look for an answer, or you could take a step back, evaluate your expectations, and then decide not to do what you're trying to do.

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

#58

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). P…

> 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.

Sure, if you can set a max budget. Otherwise, you'd constantly have to worry about the unbounded cost.

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

#59
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…

Cloudflare Transform Rules let you rewrite URLs on the fly https://developers.cloudflare.com/rules/transform/

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

#60

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). P…

Different strokes for different folks.

This has been one of the big knocks on AWS, that a poor little old lady can setup a "free" AWS account then when her website (and accompanying Lambda function) goes viral she gets hit with a $100k bill from uncle Jeff.

Post reply on HN