Apache Oozie
A workflow scheduler for Hadoop jobs, where workflows are defined in XML and can wait for data before running.
Apache Oozie is a workflow scheduler system for managing Hadoop jobs. A workflow is a graph of actions defined in XML, where each action runs a job such as a Hive query or a processing task. Coordinator jobs run workflows repeatedly, and can be set to wait until the data a workflow needs is present.
What Oozie is for
Apache Oozie is a workflow scheduler for Hadoop. Its purpose is to run a series of jobs in the right order, at the right time, on a Hadoop cluster.
Processing on a cluster rarely consists of one job. Data is ingested, then transformed, then aggregated, then loaded, and each step depends on the one before it. Oozie exists to describe that sequence and run it.
Workflows
A workflow is the sequence itself. It is written as an XML document listing actions and the transitions between them.
An action is one job. The available types reflect where Oozie came from, covering the job types a Hadoop platform runs, along with shell commands, notifications and calling another workflow.
Between actions sit control nodes that shape the path:
- Decision nodes branch depending on a condition.
- Fork and join nodes run several actions at the same time and wait for all of them to finish.
- Kill nodes end a workflow when something has gone wrong.
Coordinators, and the idea worth taking away
A workflow describes what runs. A coordinator decides when.
The obvious answer to when is a schedule. Every night at two. Oozie supports that, and so does every other scheduler.
Its more interesting capability is waiting for data. A coordinator can be told which input a workflow depends on, and hold the run back until that input exists.
This addresses a failure that is very common in scheduled pipelines. A job is set to run at two because the upstream feed usually lands by half past one. On the night the feed is late, the job runs anyway, finds nothing and either fails or, worse, succeeds against incomplete data.
With a data availability trigger, the run waits. The dependency is stated rather than approximated by a clock.
Bundles
Coordinators can be grouped so that a set of related recurring jobs is managed together rather than individually. This matters on platforms where the number of scheduled jobs grows into the hundreds.
How work is submitted
- The workflow definition and its supporting files are placed in cluster storage.
- A properties file supplies the values the workflow needs.
- The job is submitted to the Oozie server.
- The server runs the actions in order, launching each on the cluster.
- Progress and history are visible through the server's interface.
Who used it
Oozie is found on established Hadoop platforms, operated by the data engineering or platform team responsible for scheduled processing. It is most often encountered today by teams working with an existing estate rather than starting a new one.
Points to be aware of
XML is verbose. A workflow with a dozen actions is a long document, and this is the most common complaint about Oozie compared with schedulers where workflows are written in a programming language.
Its action types are also oriented towards Hadoop. That is efficient inside such a platform and limiting outside one.
As with any long established project, checking the official site for release activity and current status is worth doing before selecting it for new work.
Reference
The official project site publishes the documentation, covering the workflow specification, every action type, the coordinator and bundle specifications and the command line interface used to submit and manage jobs.
Key features of Apache Oozie
Capabilities described in the official documentation.
Workflows defined in XML
A workflow is a document listing actions and the transitions between them, rather than a program to be compiled.
Action types for Hadoop jobs
Actions cover the job types found in a Hadoop estate, along with shell commands, notifications and calling other workflows.
Control nodes
Decision, fork and join nodes allow a workflow to branch on a condition and to run several actions in parallel.
Coordinators triggered by time or data
A coordinator can start a workflow on a schedule and can also wait until the input it depends on has arrived.
Advantages of Apache Oozie
Factual advantages that follow from the features above.
Jobs wait for their inputs
Data availability triggers avoid the pattern of a scheduled job running before the data it needs is present.
Definitions are plain documents
A workflow is a file, so it can be stored, compared and moved between environments like any other configuration.
Designed for the Hadoop stack
Actions map onto the job types a Hadoop platform runs, so common work does not need wrapping in generic tasks.
Related schedules are managed together
Bundles group coordinators so a set of recurring jobs is handled as one rather than one at a time.
Common use cases for Apache Oozie
Situations the official documentation describes this tool as being used for.
Chaining a nightly processing sequence
A workflow runs an ingestion job, then a transformation, then a load, with each step waiting for the one before it.
Running only when data arrives
A coordinator waits for the expected input directory to appear before starting the workflow that processes it.
Managing recurring cluster work
Recurring jobs across a Hadoop platform are grouped and scheduled centrally rather than through separate scripts.
Running steps in parallel then joining
Fork and join nodes run several actions at once and wait for all of them before the workflow continues.
Official website
Everything on this page is based on the official documentation for Apache Oozie. You can read the source here.
Apache Oozie official documentation