db-scheduler stores scheduled task executions in a relational database so Java applications can resume work after a restart and coordinate task pickup across multiple application instances. It is a good fit when database-backed persistence and straightforward clustered scheduling matter more than exact-time execution or guaranteed catch-up: the scheduler polls for due work, and the project explicitly says that not every instant in a recurring schedule is guaranteed to run.
What db-scheduler does
db-scheduler is an embeddable Java task scheduler inspired by the need for a clustered version of ScheduledExecutorService. Its documented model uses a relational database table, typically named scheduled_tasks, to track future executions. Scheduler instances check the table for due work, claim an execution, run its task handler, and use the task’s schedule or handler to determine what happens next. The project describes its approach as simpler to operate than Quartz, but that is the project’s design goal, not an independent comparison or ranking. Project documentation
As an Amazon Associate I earn from qualifying purchases.
Because execution state is stored in the database rather than only in one process’s memory, a restart does not inherently erase scheduled executions. Multiple scheduler instances can use the same database to coordinate pickup. Depending on polling strategy, the project documents optimistic locking or select-for-update to prevent two instances from claiming the same execution. That coordination does not make task handlers exactly-once: a process can fail around the time it performs an external side effect, so handlers that cannot safely repeat should be designed with idempotency or their own transactional safeguards.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallWhat you need before adopting it
- Java 17 or later: this is the documented minimum in the project README.
- A relational database: scheduled execution state is persisted in a database table. Account for schema creation, database access, and routine database operations in the service’s deployment plan.
- A compatible database and polling strategy: database engines differ in documented locking support and timestamp requirements; check the current compatibility notes and schema before choosing a pairing.
The official releases page listed v16.12.0 as the latest release when the reviewed release information was retrieved. The README’s dependency example shows 16.11.0, so use the release page to confirm the version and notes you intend to deploy rather than treating the example as current.
Database support and locking differences
The README lists PostgreSQL, SQL Server, MySQL, MariaDB, Oracle, SQLite, and HSQLDB. Its compatibility table distinguishes generic fetch from lock-and-fetch support. The table below summarizes that documented distinction; it is not a substitute for checking the current schema and engine-specific setup instructions.
| Database | Documented fetch support | Documented lock-and-fetch support |
|---|---|---|
| PostgreSQL | Yes | Yes |
| SQL Server | Yes | Yes |
| MySQL 8+ | Yes | Yes |
| MariaDB | Yes | Not listed |
| Oracle | Yes | Not listed |
| SQLite | Yes | Not listed |
| HSQLDB | Yes | Not listed |
“Not listed” means the README compatibility table does not identify lock-and-fetch support for that engine; it should not be read as a claim that the database cannot be used. The project also calls out engine-specific timestamp handling: MySQL and MariaDB require UTC persistence, while Oracle has timestamp-type guidance. Confirm those instructions against the version and database configuration you will run. Database compatibility and schema documentation
Rank #2
Schedules, polling, and the limits of timing guarantees
The library supports one-time executions, recurring tasks with static schedules, and recurring tasks whose schedules are persisted dynamically at runtime. Documented recurring schedule types include fixed delay, daily schedules with optional time zones, and Spring-style cron expressions. SchedulerClient can list, schedule, reschedule, and remove persisted executions. These operations make it possible to inspect or change scheduled work through application code rather than relying only on in-memory timers. Scheduling and SchedulerClient documentation
The README gives defaults of 10 scheduler threads and a 10-second polling interval. Polling affects when a due execution is noticed: absent an early check, the scheduler checks the database on its configured interval. A polling interval is not a promise that a task starts at an exact wall-clock instant; workload, database response, and execution capacity also matter.
More importantly, recurring work is not a guaranteed replay of every nominal schedule point. The project states: “There are no guarantees that all instants in a schedule for a RecurringTask will be executed.” The next time is calculated after the previous task finishes. If a task runs longer than the interval, or the application is unavailable, db-scheduler should not be assumed to queue one run for every missed instant. For strict catch-up, accounting, or deadline requirements, define that behavior explicitly in the application or choose a system whose documented semantics meet those requirements. Project README
Retries and recovery after failure
Failure behavior depends on whether the execution is one-time or recurring. The README documents that recurring tasks are rescheduled according to their schedule by default, while failed one-time tasks retry after five minutes. A dead execution, such as one left behind by a JVM exit with a stale heartbeat, is handled by a configurable dead-execution handler; the documented default revives it by rescheduling it to run now. These defaults are useful starting points, not a universal recovery policy: assess how retries interact with the task’s side effects and whether retry timing is appropriate for your workload. Failure and dead-execution handling
Rank #4
Task data is serialized, with Java serialization as the default and Gson, Jackson, and Kotlin options documented. Persisted payloads may outlive the application version that wrote them, so changes to task-data classes and serializers need a compatibility plan. Treat rolling upgrades and old queued executions as part of the schema and application migration design.
Recommended Free Tools
Spring Boot integration
The project provides Spring Boot starter modules and documents exposing task definitions as beans. It distinguishes a starter for Spring Boot 3.x from a separate Boot 4 starter, and describes optional health information and configuration through properties or override beans. Confirm the current project instructions for the exact starter artifact and supported framework version before adding the dependency; framework compatibility can change between releases. Spring Boot integration documentation
Best Value
When db-scheduler is a sensible choice
- Consider it when a Java service needs one-time or recurring work to survive process restarts, and a relational database is already an acceptable operational dependency.
- Consider it when several application instances should coordinate task pickup, and the selected database’s documented fetch and locking behavior matches the deployment.
- Plan additional logic when business rules require catching up every missed interval, exact-time starts, or protection against repeated external side effects.
- Evaluate alternatives when the added database table, database-specific setup, or serializer and migration responsibilities are a poor fit for the service.
The README also says the project is “Tested to handle 2k – 10k executions / second.” It does not provide a publication year, workload description, or benchmark methodology in the cited passage, so that project-reported figure should not be treated as an independently verified throughput guarantee or used alone for capacity planning. Project README
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




