Apache NiFi

Apache NiFi is open-source software for automating and managing the flow of data between systems. It is a powerful and reliable system to process and distribute data. It provides a web-based User Interface for creating, monitoring, & controlling data flows. It has a highly configurable and modifiable data flow process that can modify data at runtime. It is easily extensible through the development of custom components.

Why Use Apache NIfi?

Here, are reasons for using Apache Nifi:

  • Allows you to do data ingestion to pull data into NiFi, from numerous data sources and create flow files
  • It offers real-time control which helps you to manage the movement of data between any source & destination
  • Visualize DataFlow at the enterprise level
  • Provide common tooling and extensions
  • Allows you to take advantage of existing libraries and Java ecosystem functionality
  • Helps organizations to integrate Nifi with their existing infrastructure
  • NiFi is designed to scale-out in clusters which offer guaranteed delivery of data
  • Visualize and Monitor performance, behavior in a flow bulletin which offers insight and inline documentation
  • Helps you to start and stop components separately or at the group level
  • It helps you to listen, fetch, split, aggregate, route, transform and drag & drop Dataflow

History of Apache NiFi

  • Developed at NSA for over eight years
  • 2014- It was donated to the Apache Software Foundation
  • 2015- NiFi became an official part of the Apache Project Suite
  • Since then every 6-8 weeks, Apache NiFi releases a new update

NiFi Architecture

Apache NiFi has a well-thought-out architecture. Once data is fetched from external sources, it is represented as FlowFile inside Apache NiFi architecture.

Here are key components of NiFi architecture

Nifi ComponentDescription
FlowFileFlowFile is original data with meta-information attached to it. It allows you to process not only CSV or other record-based data, but also pictures, videos, audio, or any other binary data.
Flowfile processorPerforms the work which acts as a building block of data flow in NiFi.
Flow controllerKeeps a record of how processes are connected. It manages the threads and allocations thereof which all processes use.
Web ServerWeb server hosts NiFi’s HTTP-based commands and API.
ExtensionThere are many types of NiFi extensions which operate and execute within the JVM.
ConnectionActs as a linkage between processors that contain a queue and relationship(s) which affects where data is routed.
Back PressureStop the system of becoming overrun by controlling the quantity or data size of flow files that can be stored in the queue.
Process GroupA process group is a set of processes and their connections, which receives and send data with the help of ports.
Flowfile RepositoryIn the FlowFile Repository, NiFi keeps track of the state of what details it has about a given FlowFile which is active in the flow.
Content RepositoryThe Content Repository is an area where the actual content bytes of a given FlowFile exist.
Provenance RepositoryThe Provenance Repository is an area where all provenance event data is gathered.

Apache NiFi Features

  • NiFi supports buffering of all queued data and offers an ability of back pressure as those queues may reach specified limits
  • NiFi allows the setting of one or more prioritization schemes
  • Provides connection processors for many data sources
  • Support any device which runs Java
  • Ideal for limited connectivity places
  • Support for troubleshooting and flow optimization
  • Offers role-based authentication/authorization
  • Allows download, recovery, and replay of individual files
  • Build your processors, controller services, and more
  • Provide content encryption, communication over secure protocols
  • Enables rapid development and effective testing
  • Allows for the development of simple single-function components that can be reused and combined to make more complex flows
  • Allows classloader isolation for easier management of dependencies

Nifi Use Cases

IndustryUsage
InsuranceRisk & underwriting analysisClaims AnalyticsUsage-based InsuranceNew product development
HealthCareSingle view of PatientReal-time vital sign monitoringEMR optimizationSupply Chain Optimization
TelecommunicationSingle view of the customerCDR analysisDynamic Bandwidth allocation
ManufacturingPreventative MaintenanceSupply Chain OptimizationQuality Control
Oil & Gas- IndustryReal-time monitoringSingle view of the OperationPredictive MaintenanceArchive & AnalyticsUnstructured data classification
Financial ServicesAnti-money launderingFraud- DetectionRisk- data management

Best practices Running Apache NiFi

  • Ideal to separate test/dev/production environments in NiFi
  • You should break your flow into process groups
  • Use a naming convention, use comments and labels
  • Organize your projects into three parts ingestion, test & monitoring
  • Use unique names for variable

Disadvantage of Nifi

  • Need precise security and compliance controls
  • You need to know the underlying system very well while working with Apache NiFi
  • Must maintain chain of custody for data
  • Transport / Messaging may not prove enough
  • Data access needs exceed available resources to transport
  • Not all data is created equally
  • SSL and topic level authorization may not be sufficient