Library / SDK
apache/shardingsphere-elasticjob avatar
apache/shardingsphere-elasticjob

ElasticJob: A Decentralized Sharding Scheduler for Java Distributed Jobs

Distributed scheduled job. ElasticJob became an Apache ShardingSphere Sub-project on May 28 2020.

8,197 stars3,248 forksJavaApache-2.0

At a glance

What is it?
Apache ShardingSphere's ElasticJob brings sharding, failover, and misfire handling to Java scheduled jobs via ZooKeeper. It targets teams that need to scale batch work across many nodes without a central scheduler.
Who is it for?
Adopt ElasticJob if you run Java 8+ batch jobs that need sharding across multiple nodes, high availability, and failover, and you already operate ZooKeeper. Skip it if you want a lightweight cron replacement, need DAG dependencies (still marked TODO), or cannot accept the operational overhead of a ZooKeeper cluster.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • apache/shardingsphere-elasticjob8,197 ★ · -11
Star history
Repository2026-07-292026-11-13
apache/shardingsphere-elasticjob8.2k8.2k

-11 Stars in the last 107 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What ElasticJob Solves and Who Needs It

ElasticJob addresses a specific pain: running scheduled jobs in a distributed environment where a single node can fail, jobs must scale horizontally, and duplicate execution is unacceptable. The README positions it as a lightweight, decentralized solution for distributed task sharding. It targets Java developers who want to avoid writing their own coordination logic for job distribution. The typical user is a team running many batch processes across a cluster, such as data synchronization, report generation, or file processing. The project lifts non-functional concerns like scale-out and high availability off the developer, letting them focus on business code. It also reduces operator burden by automating failover and resource allocation. If your jobs are simple and run on one node, ElasticJob is overkill. But for multi-node deployments, it offers a structured way to split work into shards and spread them across nodes.

The Sharding Mechanism and ZooKeeper's Role

ElasticJob's core is decentralized sharding. Unlike a central scheduler that assigns work to nodes, each ElasticJob instance coordinates with others through ZooKeeper. The README lists ZooKeeper 3.6.0 or above as a required environment, and the registry center is a core component. When a job is triggered, ElasticJob divides the job into shards, and each shard is assigned to a specific job executor. The assignment is dynamic: if a node goes down, its shards are redistributed to surviving nodes. The README mentions 'self diagnose and recover when distribute environment unstable', which suggests the system detects and recovers from network or node failures. The 'Aggregation same job to same job executor' feature implies that shards of the same job are grouped on the same executor to reduce overhead. This design avoids a single point of failure because there is no master scheduler. However, it introduces a dependency on ZooKeeper as the coordination backbone. If ZooKeeper is down, ElasticJob cannot manage shards or failover, so your jobs may not run. That is a trade-off: decentralization at the cost of an external infrastructure dependency.

Getting Started: Commands and Configuration

The README gives minimal setup instructions, but the requirements are clear. You need Java 8 or above, Maven 3.5.0 or above, and ZooKeeper 3.6.0 or above. To use ElasticJob, you add the Maven dependency from Maven Central, likely 'org.apache.shardingsphere.elasticjob:elasticjob'. The exact artifact is visible in the Maven badge URL. After adding the dependency, you configure a job against one of the job types. The README mentions a unified job API and support for job types like dataflow, script, HTTP, file, and big data. The README does not provide a code sample, so you would need to consult the official documentation at the website. The admin console, a separate project, provides a UI for job administration and event trace query. For a quick start, the repository has examples under examples/, including elasticjob-example-java, elasticjob-example-spring, elasticjob-example-springboot and elasticjob-example-embed-zk. The actual commands are not in the README, but the environment requirements are explicit.

Job Governance: Failover, Misfired, and Self-Recovery

ElasticJob's job governance features are its main selling point. The README lists failover, misfired, and self-diagnosis as core capabilities. Failover means if one node crashes mid-execution, another node picks up the shard and continues. Misfired handling deals with jobs that were supposed to run but missed their trigger, often due to node overload or network issues. The exact behavior is not detailed in the README, but typical implementations either execute the missed job immediately or discard it depending on configuration. Self-diagnosis and recovery suggest that ElasticJob monitors the health of the distributed environment and takes corrective action without human intervention. These features are essential for production batch systems where a missed job can cause data inconsistency. However, the README does not specify how these are configured or tuned. You would need to read the official docs to understand their parameters. This is a limitation: the README is high-level, so you cannot assess the robustness of these mechanisms without deeper documentation.

Limitations and Cases Where It Is the Wrong Tool

ElasticJob is not a general-purpose scheduler. The README marks 'Job Dependency' as TODO, meaning DAG-based job dependencies are not yet implemented. If your workflow requires job A to complete before job B starts, ElasticJob will not handle that out of the box. You would need to orchestrate dependencies externally. Another limitation is the mandatory ZooKeeper dependency. For small deployments, running a ZooKeeper ensemble adds significant operational overhead. If you only have a handful of jobs running on a single node, ElasticJob is over-engineered. The project also seems to have a slow release cadence: 3.0.3 in March 2023, 3.0.4 in October 2023, and 3.0.5 in February 2026. That gap suggests either stability or limited active development. The README's claim of 'lightweight' is relative; the dependency on ZooKeeper and the need for a separate admin console make it heavier than a simple cron library. For teams without existing ZooKeeper infrastructure, the learning curve is real.

Alternatives and How They Differ

The most direct alternative is Quartz with clustering. Quartz is a Java job scheduler that can run in a clustered mode using a database for persistence. The key difference is that Quartz uses a database to coordinate job locks, whereas ElasticJob uses ZooKeeper for sharding and failover. Quartz is more mature and has a smaller footprint if you already have a database. However, Quartz's clustering typically provides high availability but not sharding: it ensures one node runs a job, but it does not split a job into parallel shards across nodes. ElasticJob's sharding model allows a single job to be split into N shards and executed on multiple nodes simultaneously, which can improve throughput. Another alternative is the Spring Batch framework, which provides partitioning but requires more manual configuration. For cloud-native environments, you might consider Kubernetes CronJobs, but those do not handle cross-node sharding within a single job. The choice depends on whether you need sharding or just failover. If you need parallel processing of a large job, ElasticJob's sharding is a clear advantage. If you only need to ensure a job runs once, Quartz is simpler.

Maintenance, Upgrade Cost, and License

ElasticJob is an Apache-2.0 licensed project, which means you can use it commercially without restrictive obligations, though you must retain license notices. The project is an Apache ShardingSphere sub-project, which gives it a governance structure and a mailing list for support. The maintenance cost is tied to ZooKeeper: you must monitor and maintain the ZooKeeper cluster as part of your infrastructure. The upgrade path from 3.0.4 to 3.0.5 took over two years, so you should expect infrequent releases. That can be a benefit if you prefer stability, but it also means bug fixes and new features arrive slowly. The README does not provide a migration guide or upgrade notes, so you would need to review the release notes manually. The admin console is a separate project, which adds another component to deploy and keep in sync. Overall, the operational cost is moderate: you need to manage ZooKeeper, the ElasticJob library in your applications, and optionally the admin console. The license is permissive, which lowers the legal barrier for adoption.

Editorial conclusion

Adopt ElasticJob if you run Java 8+ batch jobs that need sharding across multiple nodes, high availability, and failover, and you already operate ZooKeeper. Skip it if you want a lightweight cron replacement, need DAG dependencies (still marked TODO), or cannot accept the operational overhead of a ZooKeeper cluster. Before adopting, verify ZooKeeper 3.6.0+ compatibility, test failover and misfire behavior under your network partition scenarios, and confirm the 3.0.5 release notes match your expectations since the project's release cadence has been slow.

Frequently asked questions

What does ElasticJob actually replace in a backend?

It takes over the non functional side of scheduled work: job scale out, high availability, failover and misfired handling, and the management that goes with them. Developers stop handling scale out and focus on business coding, and operators stop handling high availability, adding servers to grow the deployment.

What do I need installed to run ElasticJob?

Java 8 or above, Maven 3.5.0 or above, and ZooKeeper 3.6.0 or above. The repository ships a Maven wrapper as well, and the examples include elasticjob-example-embed-zk, an embedded ZooKeeper example.

Does ElasticJob support dependencies between jobs?

Not as a finished feature. Job dependency appears in the feature list with DAG based job dependency and DAG based job item dependency, but the heading is marked as a TODO, so cross job ordering is something you would build yourself.

How do I scale an ElasticJob deployment?

By adding servers. Scale out is for throughput and efficiency, processing capacity is flexible with allocated resources, the same job is aggregated to the same executor, and resources are appended to newly assigned jobs dynamically.

Where is the ElasticJob admin console and what does it do?

It lives in its own repository, shardingsphere-elasticjob-ui, rather than in this one. It covers job administration, job event trace query and registry center management.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/apache-shardingsphere-elasticjob.svg)](https://hysenlabs.com/projects/apache-shardingsphere-elasticjob)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/apache-shardingsphere-elasticjob.svg)](https://hysenlabs.com/projects/apache-shardingsphere-elasticjob)

Was this useful?