Live data from Hacker News

Supabase Edge Functions

supabase.com

61–68 of 68 posts

Re: Supabase Edge Functions

#61

Amazing work, kudos to the Supabase team! > However, Supabase already offers a flexible solution for that - Database Functions! As such, for Supabase [Edge] Functions, we decided to deploy far-and-wide so that they are as close to your end-users as possible. Does this mean that a choice has to be made between high latency (Edge Functions) and specialised SQL-only functions (Database Functions)? I see that cron-like t…

> I know a lot of folks are huge fans of writing pure SQL, the lack of type safety and lack of good intergration with source control (I dream of a world where database schemas, functions, security access and the rest can be saved to source control for reproducibility) scare me.

Hey there are some migration tools that play nice with source control. For example, Flyway has repeatable migrations https://flywaydb.org/documentation/tutorials/repeatable, here's some links about this

https://stackoverflow.com/questions/25839666/flyway-strategy...

https://github.com/flyway/flyway/issues/819

https://github.com/flyway/flyway/issues/128

Re: Supabase Edge Functions

#62

Earlier quoted context omitted.

Congratulations on launching this oft requested feature! Any timelines for support for Functions over QUIC/HTTP3 and raw UDP/TCP? Cloudflare Workers, the closest thing to Deno Deploy, announced intention to support raw TCP a few months back (while "HTTP3" has been supported for quite a long time now). Re: Database Functions: I really like the dual nature of Cloudflare's database offerings: Durable Objects (run functi…

Have you used Workers KV? In my experience, it's not just eventually consistent but also delayed - often by 10 seconds at least - the data is not updated even for the same client, unless they implement their own caching. https://community.cloudflare.com/t/how-truly-slow-is-workers... The other solution is to use cloudflare durable objects. - which is what I use, but it's very verbose. KV is a poor experience for me.

Yeah we do use KV but with explicit caching [0] and a hand-rolled reconciliation/cache-invalidation logic on top. [1]

[0] https://developers.cloudflare.com/workers/runtime-apis/cache...

[1] https://news.ycombinator.com/item?id=25295359

Re: Supabase Edge Functions

#63

Earlier quoted context omitted.

we're working closely with Cloudflare and really love their products. We did consider Cloudflare Workers - ultimately it came down to the open source philosophy of the Deno runtime. It's incredibly important to us that everything in Supabase has "escape hatches" - you can choose to host wherever you want to. I'm certain that Workers will get there eventually, but it's not there yet. We're still big fans and will be d…

> It's incredibly important to us that everything in Supabase has "escape hatches" - you can choose to host wherever you want to I'm rooting for you guys, not only your tech stack is very solid, but commitment to letting your users self-host if they want to is laudable. But here's something I don't understand about your offering. Taking a look at the pricing page https://supabase.com/pricing there is only one pricing…

Looks like we accidentally blitz the "Pay as you Go" pricing on that page after adding the Enterprise tier on Wednesday. Sorry about that

Everything in the "Pro tier" has a "usage cost" and you pay only for what you use above the $25 (or you can add a $25 spend cap to avoid an unexpected bill - https://supabase.com/blog/2022/03/30/supabase-enterprise#spe...)

I'll get the team revert the change today so that the Usage pricing is listed

Re: Supabase Edge Functions

#64

Earlier quoted context omitted.

Congratulations on launching this oft requested feature! Any timelines for support for Functions over QUIC/HTTP3 and raw UDP/TCP? Cloudflare Workers, the closest thing to Deno Deploy, announced intention to support raw TCP a few months back (while "HTTP3" has been supported for quite a long time now). Re: Database Functions: I really like the dual nature of Cloudflare's database offerings: Durable Objects (run functi…

> Any timelines for support for Functions over QUIC/HTTP3 and raw UDP/TCP? I'll ask the Deno team. I'm curious what your use-case is for these (especially UDP)? > Cloudflare's database offerings DO and KV are both incredible products. I think we'll tackle these a little differently since our "base" is Postgres. We are announcing more "edge-like" products tomorrow which will lay the groundwork

> I'm curious what your use-case is for these (especially UDP)?

Custom network devices like TURN/STUN, L4/L7 load balancers (relays, gateways), authoritative / recursive DNS, Wireguard tunnels, WebRTC etc.

> We are announcing more "edge-like" products tomorrow which will lay the groundwork.

Exciting. Thanks! (:

Re: Supabase Edge Functions

#65
post #23

Earlier quoted context omitted.

The Google Cloud Functions are not really good compared to CloudFlare Workers :/ The GCF are regioned, slow to start and behaving like an on-demand temporary cloud instance, than an actual FaaS offering.

Using golang cloud functions. I have a constant stream of hits, so there are always available functions. Connecting to cloud sql postgres and serving a request that hits the database takes under 1s. Hot request/responses are ~20ms. My hits are all US based, so I plopped myself into Central. No issues there either.

> Using golang cloud functions. I have a constant stream of hits, so there are always available functions.

There is no way to avoid cold starts althogether, there will always be tail latencies unless there is a generous amount of idle instances running that GCP charges for.

> under 1s. Hot request/responses are ~20ms.

Those numbers are great, I think Go plays a huge part in this. Google's Node.js firestore SDK is terrible... I've had 15 second cold starts, which is unacceptable for client-facing functions, there's a whole thread about it here [1]. GCP doesn't have a very wide range of language SDK support for those that don't want to use Go or Node.js...

> My hits are all US based

Edge compute, like Fly.io or Cloudflare Workers truly shines when you need to serve traffic close to the user around the world. Otherwise normal region-locked functions are fine. Vercel requires you to choose a single region, and it's locked to US-east for free-tier users. For us Europeans over here, SSR has to effectively cross the Atlantic ocean.

[1]: https://issuetracker.google.com/issues/158014637

Re: Supabase Edge Functions

#66

Amazing work, kudos to the Supabase team! > However, Supabase already offers a flexible solution for that - Database Functions! As such, for Supabase [Edge] Functions, we decided to deploy far-and-wide so that they are as close to your end-users as possible. Does this mean that a choice has to be made between high latency (Edge Functions) and specialised SQL-only functions (Database Functions)? I see that cron-like t…

> I know a lot of folks are huge fans of writing pure SQL, the lack of type safety and lack of good intergration with source control (I dream of a world where database schemas, functions, security access and the rest can be saved to source control for reproducibility) scare me. Hey there are some migration tools that play nice with source control. For example, Flyway has repeatable migrations https://flywaydb.org/doc…

There's a new one in this field bytebase.com

(Disclaimer, I am the author of it)

Re: Supabase Edge Functions

#67

Earlier quoted context omitted.

Using golang cloud functions. I have a constant stream of hits, so there are always available functions. Connecting to cloud sql postgres and serving a request that hits the database takes under 1s. Hot request/responses are ~20ms. My hits are all US based, so I plopped myself into Central. No issues there either.

> Using golang cloud functions. I have a constant stream of hits, so there are always available functions. There is no way to avoid cold starts althogether, there will always be tail latencies unless there is a generous amount of idle instances running that GCP charges for. > under 1s. Hot request/responses are ~20ms. Those numbers are great, I think Go plays a huge part in this. Google's Node.js firestore SDK is ter…

> Google's Node.js firestore SDK is terrible

I don't think it is terrible, but I do agree it is a slower startup than golang by a lot. Which is why I went with golang for this project and I stopped using firebase entirely. You really don't want to effectively be parsing all your source code every time a launch happens.

> Edge compute, like Fly.io or Cloudflare Workers truly shines when you need to serve traffic close to the user around the world.

For my app, it is really just about having another layer of control in front of my API calls. I don't care so much about the CDN aspects.

Re: Supabase Edge Functions

#68
post #27

Two questions: 1) Do the functions "freeze" once the response body has been sent back? Is it possible to return a response to the user (for a quick API response) and then continue doing some background work? This is has been a source of pain with AWS Lambda based services like Vercel that freeze execution once the response has been sent.[1] 2) How does keeping a connection pool work between function invocations? For…

> Do the functions "freeze" once the response body has been sent back? Just checked with the Deno team. These functions should not be used as "background workers" - perhaps that is something we explore in the future. It will work for a short time in theory, but it's not guaranteed. > How does keeping a connection pool work between function invocations Supabase offers several options here. You can either use the API (…

TBH the average user would be confused if their autoscaling workers were "online and billed for" if some random npm package or a coding accident had "background behavior". Firing off a background task into something similar to AWS SQS is really the right way for this scenario to be handled.
Post reply on HN