Understand Oban Clustering Modes
mainOban supports running in clusters of nodes using two primary communication methods:
- Global Mode: Nodes are connected via distributed Erlang. Oban notifies queues of available jobs via pub/sub to minimize database load.
- Local Mode: Nodes are not connected via distributed Erlang. Each queue polls the database independently. This mode is less efficient and is used as a fallback if pub/sub is unavailable.
When does Oban switch to Local Mode? Oban switches to polling in local mode if both of the following conditions are met:
- You are running with a connection pooler (like
pg_bouncer) in transaction mode. - You are running without clustering (no distributed Erlang).
If pub/sub notifications are unavailable due to these conditions, Oban defaults to local mode to ensure job processing continues.