> Also think the time for a FOSS alternative is coming. Serverless without, virtually, cold starts is here to stay but being tied to only 1 vendor is problematic.
Supabase Edge Functions runs on the same V8 isolate primitive as Cloudflare Workers and is fully open-source (https://github.com/supabase/edge-runtime). We use the Deno runtime, which supports Node built-in APIs, npm packages, and WebAssembly (WASM) modules. (disclaimer: I'm the lead for Supabase Edge Functions)
It would be interesting if Supabase allows me to use that runtime without forcing me to use supabase, being a separated product on its own.
Several years ago, I used MeteorJs, it uses mongo and it is somehow comparable to Supabase. The main issue that burned me and several projects was that It was hard/even impossible to bring different libraries, it was a full stack solution that did not evolved well, it was great for prototyping until it became unsustainable and even hard to on board new devs due to “separating of concerns” mostly due to the big learning curve of one big framework.
Having learn for this, I only build apps where I can bring whatever library I want. I need tool/library/frameworks to as agnostic as possible.
The thing I love about CloudFlare workers is that you are not force to use any other CF service, I have full control of the code, I combine it with HonoJs and I can deploy it as a server or serverless.
About the runtimes: Having to choose between node, demo and bun is something that I do not want to do, I’m sticking with node and hopefully the runtimes would be compatible with standard JavaScript.
>It would be interesting if Supabase allows me to use that runtime without forcing me to use supabase, being a separated product on its own.
It's possible for you to self-host Edge Runtime on its own. Check the repo, it has Docker files and an example setup.
> I have full control of the code, I combine it with HonoJs and I can deploy it as a server or serverless.
Even with Supabase's hosted option, you can choose to run Edge Functions and opt out of others. You can run Hono in Edge Functions, meaning you can easily switch between CF Workers and Supabase Edge Functions (and vice versa) https://supabase.com/docs/guides/functions/routing?queryGrou...
> Having to choose between node, demo and bun is something that I do not want to do, I’m sticking with node and hopefully the runtimes would be compatible with standard JavaScript.
Deno supports most of Node built-in API and npm packages. If your app uses modern Node it can be deployed on Edge Functions without having to worry about the runtime (having said that, I agree there are quirks and we are working on native Node support as well).
I'm the author of the blog post. To add more context, kids have been living with their grandparents from birth (extended family home). And grandparents usually help with the feeding and sleeping routine. We trust them to take better care of our kids than a childcare center or an au pair (which most kids with working parents have to go through as early as 4-6 months).
I knew that sharing about kids on the internet invites judgments from strangers. However, parenting is a different journey for each person and cannot be measured by the same yardstick.
Supabase Edge Runtime is easy to self-host (works great as a multi-threaded JS web server). We love community contributions :) Let us know if you would like to collaborate.
If you are building using Supabase stack (Postgres as DB with pgVector), we just released a built-in embedding generation API yesterday. This works both locally (in CPUs) and you can deploy it without any modifications.
There are no extra costs other than the what we'd normally charge for Edge Function invocations (you get up to 500K in the free plan and 2M in the Pro plan)
neat! one thing i’d really love tooling for: supporting multi user apps where each has their own siloed data and embeddings. i find myself having to set up databases from scratch for all my clients, which results in a lot of repetitive work. i’d love to have the ability one day to easily add users to the same db and let them get to embedding without having to have any knowledge going in
We have a cluster of Edge Runtime instances in each region. We run multiple edge functions within an instance using v8 isolates (Deno's core runtime is a wrapper around v8 isolates). This setup provides a good balance between cost and security. Other edge hosting providers like Cloudflare also follow a similar setup.
Hey, thanks for sharing this on HN! I'm one of the Edge Functions developers at Supabase and co-author of the blog post. We are very excited about releasing npm support and looking forward to seeing how the community build awesome apps with the Supabase stack.
I am happy to answer any questions or receive feedback.
how deep does the support go? i.e. can we safely import from node platform builtins like `os` or are the same bundling gymnastics still required there? (fwiw this is one of the major issues with vercel's edge funcs)
Most builtin modules should work (except for things like `vm` which we cannot safely sandbox in edge runtime). Deno has a good guide on the compatibility of built-in modules https://docs.deno.com/runtime/manual/node/compatibility
You can do:
```
import os from "node:os"
console.log(os.hostname())
```
and it should just work both locally and when deployed. No extra steps needed.
We used to cache the modules locally, I will need to check if we made any configuration change. Can you kindly open an issue for Supabase CLI - https://github.com/supabase/cli/issues
Hey @cjonas, I'm a developer on Supabase Edge Functions team. We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months.
Can you explain what do you mean by template URLs? Do you mean route params like `/v1/functions/users/:id`? If so, you can use a framework like Oak[1] to handle them. Edge Functions will make the full path including querystring available to the router.
Source maps, is it broken during local dev or when you deploy the function? Also, by broken you mean in a stack trace the file / line numbers aren't accurate?
> We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months.
Excited to hear more! Being able to trigger functions from DB & cron triggers without having to hardcode a secret (which causes them to end up in migrations files) will be a huge improvement.
> Can you explain what do you mean by template URLs?
Oh, I had no idea that the functions routes were "wild card"! I don't think that's mentioned anywhere in the documentation, btw.
> Source maps, is it broken during local dev or when you deploy the function?
"Source maps" (does deno actually use source maps?) ARE broken as well. EG: The line numbers in runtime don't line up with the function code in the IDE or even that is in the docker volume.
Supabase Edge Functions runs on the same V8 isolate primitive as Cloudflare Workers and is fully open-source (https://github.com/supabase/edge-runtime). We use the Deno runtime, which supports Node built-in APIs, npm packages, and WebAssembly (WASM) modules. (disclaimer: I'm the lead for Supabase Edge Functions)