Oban Releases

Pro v1.2.0

Docs

This release includes expanded priorities, defining replace in workers, notifier changes, and validation improvements which require Oban v2.17+

🗃️ DynamicPartitioner

The DynamicPartitioner plugin adds partitioned table support for optimized query performance, minimal database bloat, and efficiently pruned historic jobs. Partitioning can minimize database bloat for tables of any size, but it’s ideally suited for high throughput applications that run millions of jobs a week.

A synthetic benchmark of 7m jobs, (1m a day for 7 days), showed the following performance improvements:

  • 40% Smaller tables (6,281MB to 4,121MB)
  • 95% Less bloat after vacuum (4,625MB to 230MB)
  • 2.5x Faster vacuuming (28,638ms to 11,529ms)
  • 2.1x Faster reindexing (6,248ms to 2,939ms)
  • 1000x Faster job pruning (51,170ms to 49ms)

Systems with higher throughput may see more dramatic performance and bloat improvements.

See the DynamicPartitioner docs for more details and instructions on switching over.

⏰ Scheduling Guarantees

The DynamicCron plugin gained an option to improve reliability with schedule guarantees. Depending on an application’s restart timing or as the result of unexpected downtime, a job’s scheduled insert period can be missed. To compensate, you can enable guaranteed mode for the entire crontab or on an individual bases.

In guaranteed mode, jobs inserts are attempted every minute, but with uniqueness calculated to prevent any overlaps. Here’s an example of enabling guaranteed insertion for the entire crontab:

[
  guaranteed: true,
  crontab: [
    {"@hourly", MyApp.HourlyJob},
    {"@daily", MyApp.DailyJob},
    {"@monthly", MyApp.DailyJob, guaranteed: false},
  ]
]

See DynamicCron’s section on scheduling guarantees for use cases, configuration, and potential caveats.

🪪 UUIDv7 for Binary Ids

Now producers, batches, and workflows all use time-ordered UUIDv7 values for binary ids. UUIDv7 has natural ordering while retaining UUID compatibility, making it a direct replacement with sortability and more efficient indexing.

This change uses a pure Elixir implementation and doesn’t introduce any dependencies or new Postgres requirements.

Bug Fixes

  • [DynamicQueues] Drop unsupported :only option before calling Oban.scale_queue

Pro v1.2.1

Docs

Bug Fixes

  • [Testing] Use a valid peer module for all test helpers

    Testing used a custom Oban.Peer compatible module that didn’t specify the Peer behaviour, but that module isn’t considered valid as of Oban v2.17.

Pro v1.2.2

Docs

Bug Fixes

  • [DynamicPartitioner] Select fields in an explicit order for backfilling

    Tables created by older versions of Oban may have slightly different column structures and we can’t rely on implicit select ordering when backfilling unpartitioned jobs.

  • [DynamicPartitioner] Makde unlogged oban_peers migration reversible

    The execute command lacked a secondary, down clause, making it impossible to rollback.

  • [DynamicPruner] Pass configured timeout as option to outer transaction

    Only the inner delete_all call had the timeout applied, which didn’t extend the timeout for the outer transaction.