Live data from Hacker News

Supabase Edge Runtime: Self-Hosted Deno Functions

supabase.com

61–70 of 105 posts

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#61
post #20

just use a regular server for mid/larger sized apps. i started my web dev journey with JAMStack, Vercel, the "edge". everything is easy as long as one only deploys a full-stack NextJS app. the moment other apps come in, just use a server deployed as VPS and avoid "edge runtime hell". edge runtime hell refers to "you can't do this (function with over 2MB payload), you can't do that (because not supported by X)". EDIT:…

I'm coming around to building everything for a VPS from the outset. There's a lot of upside to VPSes, such as: 1. Can be purchased as a fixed cost, usually at a rate that's much cheaper than on-demand pricing, and especially serverless--this tends to only get better with time as competition keeps prices low 2. It's "just" a Unix/Windows/Mac box, so the issues with runtime constraints you mention are bounded different…

I've been using Coolify on a Hetzner VPS, it works great, it's like an open source Heroku that works through Docker and Compose.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#62
post #20

Earlier quoted context omitted.

I'm coming around to building everything for a VPS from the outset. There's a lot of upside to VPSes, such as: 1. Can be purchased as a fixed cost, usually at a rate that's much cheaper than on-demand pricing, and especially serverless--this tends to only get better with time as competition keeps prices low 2. It's "just" a Unix/Windows/Mac box, so the issues with runtime constraints you mention are bounded different…

I've been using Coolify on a Hetzner VPS, it works great, it's like an open source Heroku that works through Docker and Compose.

I had a look at it and it seemed interesting, but then I spotted the `-v /var/run/docker.sock:/var/run/docker.sock`.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#63
post #35

hey hn, supabase ceo here This is a webserver for Deno. It is MIT licensed, written in Rust, and based on the latest Deno Runtime (1.32+). It can serve TypeScript, JavaScript, and WASM functions. This one is important for local development and self-hosting. For local development, it ensures there is parity between development and production. For self-hosting, it means you can deploy and manage your Deno Functions on…

Great work! I've been dabbling with deno for a couple years now, one of the most powerful features I'm excited about is BroadcastChannel[1] support, which works with --unstable in Deno Deploy. One of the challenges I've run into is debugging timeouts in deno deploy, so I'm curious-- 1. is BroadcastChannel supported in supabase self-hosted edge functions? 2. is there more tooling available to supabase edge functions t…

[Supabase engineer & author of the blog post here.]

Thanks! Good Questions

1. We haven't enabled BroadcastChannel in the Edge Runtime. Mainly because we haven't found good use cases for it within Edge Functions (it does make sense as a way to subscribe within a browser client, but not sure how it fits with async/short-lived nature of Edge Functions). Curious about how you plan to use BroadcastChannel in Edge Functions?

2. As I've mentioned in the blog post Edge Runtime allows you to tweak the duration and memory available for an Edge Function (check the examples/main/index.ts in the repo too). Personally, I use this option to debug timeouts and memory issues on Edge Functions. We also plan to introduce better ways to profile your Edge Functions in the future.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#64
post #59

hey hn, supabase ceo here This is a webserver for Deno. It is MIT licensed, written in Rust, and based on the latest Deno Runtime (1.32+). It can serve TypeScript, JavaScript, and WASM functions. This one is important for local development and self-hosting. For local development, it ensures there is parity between development and production. For self-hosting, it means you can deploy and manage your Deno Functions on…

Interesting! Do you have an idea of what it would mean performance/latency wise to replace kong with this?

We are yet to complete our Kong replacement. Once we do that, we'll probably publish another blog post with performance benchmarks.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#65

How about WASM functions? One of Deno's selling points is sandboxing but WASM takes it to a new level it seems. I've been looking into Spin and also Dapr with WasmEdge. There is even QuickJS which does JavaScript.

[Supabase engineer & author of the blog post]

You can already use WASM modules within Edge Functions. We have an example on using WASM modules to generate OpenGraph images - https://github.com/supabase/supabase/tree/master/examples/ed...

We are also exploring ways to create functions in WASM-supported languages and run them directly on Edge Runtime. We expect this would be easier WasmGC[0] is shipped and Deno's WASI support improves.

[0] https://chromestatus.com/feature/6062715726462976

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#66
post #62

Earlier quoted context omitted.

I've been using Coolify on a Hetzner VPS, it works great, it's like an open source Heroku that works through Docker and Compose.

I had a look at it and it seemed interesting, but then I spotted the `-v /var/run/docker.sock:/var/run/docker.sock`.

In case anyone's wondering, that gives the container root level access to the host's Docker daemon. A big potential security hole.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#67
post #62

Earlier quoted context omitted.

I had a look at it and it seemed interesting, but then I spotted the `-v /var/run/docker.sock:/var/run/docker.sock`.

In case anyone's wondering, that gives the container root level access to the host's Docker daemon. A big potential security hole.

It's also just generally wrong to build a scheduler on top of the docker API. We have CRI for a reason, because everyone knows Docker is not going to be around forever. Certainly not the company. Maybe dockerd.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#68

Earlier quoted context omitted.

Is Supabase targeted towards webdev "apps" or mobile "apps"? As a mobile dev I got excited to check out a Firebase + serverless alternative, but the docs seem very targeted towards webdevs and non-native apps. I see there's a 1.0 Swift library that's available, would love if someone can chime in with their experience using that in an iOS app.

They seem to have Flutter support but the lack of React Native support is non starter for me.

I'm working on several RN + Supabase projects and it just works !

There were a few kinks initially, like URL polyfil being missing from RN and the need for AsyncStorage alongside supabase.js but they've all been rectified by the team or made more clear using their Expo instructions in the docs — Although maybe it'd be clearer for people that the expo guide is for RN? People who haven't started using RN might not know the connection?

It's such a pleasant stack, we're experimenting currently with edge functions in place of an API in certain places, so far it's just to use Cloudflare Turnstile to insert contact form records into a database, but it's super trivial.

Excited for the future of edge functions!

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#69
post #56

hey hn, supabase ceo here This is a webserver for Deno. It is MIT licensed, written in Rust, and based on the latest Deno Runtime (1.32+). It can serve TypeScript, JavaScript, and WASM functions. This one is important for local development and self-hosting. For local development, it ensures there is parity between development and production. For self-hosting, it means you can deploy and manage your Deno Functions on…

Congrats on the launch! I’ve been so underwhelmed with Lambda’s lack of forward progress lately and have been wanting to play around a bit with V8 isolates. This looks like a super-easy way to get a runtime spun up and handling requests on AWS.

Open question: what are the benefits of replacing Lambda with this new service, if you’re not using any other Supabase functionalities?

Our Lambdas are currently written in Typescript and built with esbuild. We zip them and push to AWS.

Re: Supabase Edge Runtime: Self-Hosted Deno Functions

#70

does any one have good practical experience running Supabase locally? Its against their business model to have this run well so I'm a bit scared of the growing lock-in. (P.S. if Supabase is listening some customers like myself would be willing to pay a significant amount for support in a kubernetes/docker deployment running on our servers. We currently pay $50k - $100k simply for enterprise support contracts for each…

Hey there - Tim here from Supabase! We have some options to explore here so probably best to connect on a call to get a better understanding of your project and how we can best align to help! Can you send me an email on tim@supabase.io and we can tee up a time? Cheers, Tim
Post reply on HN