Transactional job queue library for Elixir using Ecto, PostgreSQL/MySQL, and GenStage for reliable background processing.
EctoJob is a transactional job queue library for Elixir applications that uses Ecto and GenStage to provide reliable background job processing. It ensures job execution is atomic with other database operations, making it suitable for applications requiring consistency and fault tolerance.
Elixir developers building applications that need reliable, transactionally-safe background job processing integrated with their existing Ecto-based database workflows.
Developers choose EctoJob for its seamless integration with Ecto transactions, allowing jobs to be enqueued only if other database operations succeed, and for its library-based design that offers flexibility without requiring a full OTP application.
Transactional job queue with Ecto, PostgreSQL and GenStage
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Jobs can be enqueued within Ecto.Multi transactions, ensuring they only queue if other database operations succeed, which is explicitly demonstrated in the enqueueing examples.
Supports delayed execution with configurable schedule times and automatic retries with exponential backoff, as detailed in the job lifecycle and configuration options.
Uses PostgreSQL notifications to minimize delay between job insertion and processing, unlike the polling required for MySQL, which is highlighted in the compatibility section.
Designed as a library of functions rather than a full OTP application, allowing easy integration into existing supervision trees and workflows for flexibility.
Only fully optimized for PostgreSQL; MySQL support is non-optimized, requires specific versions (8.0.1+), and uses polling, which can increase latency, as admitted in the README.
Lacks a dashboard or tools for inspecting job queues, failed jobs, or performance metrics, requiring developers to build custom solutions or rely on database queries.
Handling timeouts, retries, and failed jobs involves understanding multiple states and configurations, which can be error-prone and require careful tuning to avoid issues like duplicate side effects.