Skip to main content

Apache NiFi

At a glance
  • Problem solved: automate moving, routing and transforming data between systems that share neither formats nor protocols, with full traceability of every piece of data.
  • Era: developed at the NSA since late 2006 (Niagarafiles); Apache Incubator on November 24, 2014; Apache top-level project on July 15, 2015; NiFi 1.0 in August 2016, NiFi 2.0 in November 2024.
  • Created by: Joe Witt and a team from the NSA and defense contractors; later carried by Onyara, then Hortonworks.
  • Category: data integration / dataflow.

Historical context​

The problem is as old as enterprise computing: as soon as there is more than one system, data has to flow from one to another. The NiFi documentation puts it this way: "NiFi was built to automate the flow of data between systems". In practice, that job was long done by ad hoc scripts, fragile in the face of failures, volume spikes and format changes. The incubation proposal lists the difficulties: growing volumes and rates, an increasing number of protocols and formats, and the need for visibility.

NiFi was born at the NSA (National Security Agency) under the name Niagarafiles. According to the proposal filed with the ASF, it had been in active development "since late 2006". Its creator, Joe Witt, told eWeek [S] that he wrote the software in 2006, then grew it with other developers to "solve unique problems seen at NSA". The NSA explains that the goal was to identify and prioritize the most important information across its communications infrastructure, because the value of intelligence depends above all on its freshness. By adding context to each flow, NiFi creates a "fine-grained chain of custody" that quickly attracted interest across the US intelligence community.

On November 25, 2014, the NSA announced the release of the code: it was the first in a series of open source releases from its Technology Transfer Program. The project had entered the Apache Incubator the day before (November 24, 2014), with seven initial committers, employees of the NSA or of contractors (Raytheon, Sotera Defense Solutions, Requitest). The code was published on December 8, 2014 and the first release, 0.0.1, came out on January 29, 2015. On July 15, 2015, the ASF board made NiFi a top-level project. Joe Witt, the project's vice president, then spoke of a project with "more than eight years of development in a closed source environment".

What followed was commercial. The main developers founded Onyara, a 10-person startup created in March 2015 according to VentureBeat [S]. On August 22, 2015, Hortonworks signed an agreement to acquire it for about 1.6 million of its shares (8-K filing with the SEC), and launched Hortonworks DataFlow, powered by NiFi, alongside its Hadoop distribution. Hortonworks later merged with Cloudera, in 2018 according to the NSA. NiFi 1.0 (August 2016) removed the cluster's master node; NiFi 2.0 (November 2024) moved to Java 21 and added processors written in Python.

Key idea​

NiFi applies flow-based programming, described by J. Paul Morrison in the 1970s: processing is a graph of black boxes connected by bounded queues. Each object in transit, the FlowFile, carries attributes (key/value) and content. Everything is buffered and journaled: if a downstream system slows down, the queue fills up and applies back pressure; if a machine fails, nothing is lost; and each step leaves a provenance record that lets you find, and even replay, the path of a piece of data. The flow is edited live in the browser: the documentation says NiFi is less "design and deploy" than "molding clay".

How it works​

Mapping between NiFi terms and flow-based programming terms, according to the documentation:

NiFi termFBP termRole
FlowFileInformation PacketObject in transit: key/value attributes + content of 0 bytes or more
ProcessorBlack BoxDoes the work: routing, transformation, mediation between systems
ConnectionBounded BufferQueue between processors, prioritizable, bounded (back pressure)
Flow ControllerSchedulerAllocates threads to processors
Process GroupSubnetReusable subgraph with input and output ports
  • Three on-disk repositories: the FlowFile Repository (FlowFile state, by default a write-ahead log), the Content Repository (the bytes) and the Provenance Repository (indexed, searchable events).
  • Guaranteed delivery: thanks to the log and the content repository, even at high throughput. Quality of service is set per flow: loss tolerance, latency versus throughput, queue priority (oldest first by default).
  • Cluster: since 1.0, a zero-leader model; Apache ZooKeeper elects a coordinator and a primary node, and each node processes part of the data.
  • Extensions: processors, Controller Services, Reporting Tasks, packaged as NAR archives with isolated class loaders.
  • Site-to-Site: a dedicated protocol to transfer data between NiFi instances; MiNiFi is the lightweight edition for the edge.

A typical flow, the List/Fetch pattern mentioned in the release notes: a first processor lists new files on a server (FTP, SFTP, HTTP), a second one fetches them, others route them according to their attributes, then a last one delivers them to HDFS or Kafka. Each link between two processors is a queue visible in the interface, with its fill level.

By the numbers​

FigureContextSource
late 2006Start of Niagarafiles development at the NSAASF incubation proposal
7Initial committers when entering incubation (2014)ASF incubation proposal
under 8 monthsFrom Nov. 24, 2014 (incubation) to July 15, 2015 (top-level)ASF Incubator page
1.6 millionHortonworks shares exchanged for Onyara (agreement of Aug. 22, 2015)Hortonworks 8-K, SEC
75%Compile time saved by a German contributor one month after the releaseNSA, Tech Transfer (2021)
60+Contributors who developed features (2021)NSA, Tech Transfer (2021)
100 MB/sTarget throughput per node for a large class of flows, on modest disksNiFi Overview docs
900+Issues resolved in NiFi 2.0.0-M1 (Nov. 2023)NiFi release notes

Milestones​

  • Late 2006: development of Niagarafiles starts at the NSA.
  • November 24, 2014: enters the Apache Incubator; the NSA announces the release on the 25th.
  • January 29, 2015: NiFi 0.0.1 (incubating).
  • July 15, 2015: Apache top-level project (public announcement on July 20).
  • August 25, 2015: Hortonworks announces the acquisition of Onyara and launches Hortonworks DataFlow.
  • August 30, 2016: NiFi 1.0, new interface, clustering without a master node, multi-tenant authorization.
  • 2018: Hortonworks / Cloudera merger (according to the NSA).
  • November 25, 2023: NiFi 2.0.0-M1, first native Python API for processors.
  • November 4, 2024: NiFi 2.0.0, first GA release of the 2.x line.

Did you know?​

  • According to VentureBeat [S], NiFi is pronounced "NIGH-figh", short for Niagara Files.
  • The 2014 incubation proposal states that there was "no NiFi documentation on the web" at the time: documentation only existed inside the application.
  • An NSA technical director considers that presenting NiFi as an open source project born at the agency is "a great tool in attracting the brightest new hires".
  • The 2.0 release notes apologize to teams using NiFi "in SOC or other dark rooms": dark mode finally arrives.

Strengths and limitations​

StrengthsLimitations
Flows designed and modified live, in the browserNot an analytical compute engine (aggregations, massive joins)
Fine-grained provenance: find and replay a piece of data's pathThroughput bounded by on-disk repositories (FlowFile and provenance)
Guaranteed delivery, back pressure, queue prioritizationMemory limited by the JVM and garbage collection
Large catalog of extensions (SFTP, HTTP, HDFS, Kafka...)Visual flows are harder to version than code

What came next​

  • Often placed upstream of Kafka or of a Hadoop data lake, whose HDFS it feeds.
  • Complementary to a batch orchestrator like Airflow: NiFi moves continuous flows, Airflow schedules jobs.
  • For database change capture, see Debezium; for EL ingestion into a warehouse, see Airbyte.

Sources​

To do
  • Number of processors shipped in the current distribution (official source to find).
  • Exact closing date of the Onyara acquisition and of the Hortonworks / Cloudera merger (primary source).
  • Onyara's founding date (March 2015): only sourced by the press [S].