Does Oban work with a Supabase postgres database?

This is an Ecto/Oban question.

I have my database on Supabase. Does Oban work with Supabase?

I can connect to the database just like I would with any regular Postgres instance via database url.

In the Oban docs:

Usually, scheduled job management operates in global mode and notifies queues of available jobs via PubSub to minimize database load. However, when PubSub isn’t available, staging switches to a local mode where each queue polls independently.

Local mode is less efficient and will only happen if you’re running in an environment where neither Postgres nor PG notifications work. That situation should be rare and limited to the following conditions:

  1. Running with a connection pooler, i.e., pg_bouncer, in transaction mode.
  2. Running without clustering, i.e., without Distributed Erlang

If both of those criteria apply and PubSub notifications won’t work, then staging will switch to polling in local mode.

I guess what I’m asking is, does Supabase’s postgres have notifications for Oban to work? Has anyone used Supabase with Oban? Thank you!

1 Like

Oban definitely works with Supabase. In fact, that’s what we used initially for the 1 billion jobs a day benchmark behind the “Scaling Oban Jobs” talk at ElixirConf EU. It wasn’t up to the task :neutral_face:

There may be modes where Supabase allows listen/notify for pubsub. However, we highly recommend using an alternative notifier such as Oban.Notifiers.PG in a clustered environment.

5 Likes