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 callingOban.scale_queue