#Trigger as an alternative to Supabase edge functions for higher CPU and memory needs?

1 messages · Page 1 of 1 (latest)

vapid kernel
#

Hello, I've been doing research today to figure out whether Trigger will fit our use-case and decided I might as well ask directly. We have a fairly large Supabase edge function that's outgrowing Supabase's limits (both memory and CPU time). The main constraint is the CPU time limit.

We've been exploring the idea of migrating the function into a Trigger job. Is Trigger realistic for a job that might take, in a worst-case scenario, 30s wall clock time (with pretty high CPU usage, but some network requests) and 500 MB of memory? We would probably trigger it using a database webhook or the official Supabase integration.

nocturne bay
#

We've just launched the developer preview of v3 of Trigger where we deploy code for you with no timeouts. You might have already seen in as we link to it from the homepage: https://trigger.dev/blog/v3-developer-preview-launch/

This would be a good fit for this use case. You can optionally select vCPU and RAM settings (250MB to 8GB).

The developer preview is early at the moment so we don't have some of the features you will have seen from v2. For example, we don't have webhook triggers yet. Are you deploying code somewhere else other than Supabase?

vapid kernel
#

We do have an Astro app that interacts with Supabase, but the current edge function is being called by a separate Rails app when a specific event happens in that app, so I don't think we could trigger the job from Astro.

nocturne bay
#

This is how I would do it I think:

  1. You trigger a task from your Supabase edge function, with the data you need to use to start. Could just be an ID of a row or the entire data.
  2. The Trigger.dev task would do the work.

We won't have webhook support for a couple of months so you'd have to do something like this. What's your timescale on building this?

vapid kernel
#

Thanks, that makes sense. I'll chat a bit with my coworkers tomorrow. We're building this soon but your idea sounds like a good option until webhooks come out.