Abstract network of connected data points representing a data flow

Apache NiFi basics come down to three ideas: FlowFiles carry data, processors act on it, and connections queue it between steps. This Mintopsblog.com primer explains those parts, how a simple flow is built and what to check before you run NiFi in production.

Key Takeaways

  • Apache NiFi is an open-source tool for moving and transforming data between systems with a visual flow editor.
  • A FlowFile is one piece of data plus attributes; processors route, transform and deliver FlowFiles.
  • Connections are queues with back pressure, so a slow step does not overwhelm the rest of the flow.
  • Data provenance records what happened to every FlowFile, which helps with audits and debugging.

What Apache NiFi Is For

Apache NiFi is a project of the Apache Software Foundation built to automate the flow of data between systems. You design flows in a web interface by dragging processors onto a canvas and linking them, and NiFi runs them continuously. The official NiFi documentation covers every component; this article focuses on the ideas a beginner needs first.

Typical jobs include picking up files from a directory or SFTP server, calling REST APIs, reading from message queues such as Kafka, converting formats like CSV to JSON, enriching records, and writing the results to databases, object storage or search engines. NiFi suits teams that want visible, adjustable data pipelines without writing a full application for each one.

Core Building Blocks

ComponentWhat it isExample
FlowFileOne unit of data (content) plus key-value attributesA CSV file with attributes for filename and size
ProcessorA step that creates, changes, routes or sends FlowFilesGetFile, ConvertRecord, PutDatabaseRecord
ConnectionA queue that links two processorsSuccess output of one step to the input of the next
RelationshipA named outcome of a processorsuccess, failure, retry
Process groupA container that groups part of a flowOne group per data source
Controller serviceShared configuration used by many processorsA database connection pool or SSL context

FlowFiles and Attributes

Each FlowFile has content, stored in NiFi’s content repository, and attributes, which are small text values such as filename, path or a custom customer.id. Processors read attributes to make decisions, for example RouteOnAttribute can send files from one source down a different path. Keeping decisions in attributes avoids re-reading large content.

Back Pressure and Queues

Each connection has thresholds for the number of FlowFiles and the total data size it may hold. When a queue reaches its limit, NiFi stops scheduling the processor that feeds it. This back pressure protects memory and disk and lets a slow destination catch up instead of crashing the flow.

Building a First Flow

A good first exercise is a flow that watches a folder, converts CSV files to JSON and writes the result to another folder. The steps below use processors that ship with NiFi:

  1. Add a GetFile (or ListFile plus FetchFile) processor that points at an input directory.
  2. Add ConvertRecord and configure a CSVReader and a JsonRecordSetWriter as its controller services.
  3. Add PutFile pointing at an output directory.
  4. Connect GetFile to ConvertRecord on success, and ConvertRecord to PutFile on success.
  5. Route the failure relationship to a separate PutFile or a funnel so bad records are kept for review, not lost.
  6. Start the processors one by one and watch the queue counts and bulletins.

Every relationship must be connected or auto-terminated before a processor can start. That rule forces you to decide what happens to failures, which is one of NiFi’s strengths.

Data Provenance

NiFi records provenance events for every FlowFile: when it was received, changed, routed, cloned or sent. In the interface you can search those events, see the content before and after a step, and replay a FlowFile. That trail is valuable for compliance and for answering “where did this record go?” questions.

Security and Production Checks

Recent NiFi versions start with HTTPS and single-user login enabled by default. For shared or production use, connect authentication to a directory such as LDAP, which our LDAP explainer introduces, and define access policies per process group. Use a controller service for TLS settings so certificates are managed in one place; the guide to how SSL/TLS certificates work covers the basics.

  • Place the content, FlowFile and provenance repositories on disks with enough space and monitor them.
  • Use parameter contexts for passwords and environment values instead of hard-coding them in processors.
  • Version flows with NiFi Registry or exported definitions so changes can be reviewed and rolled back.
  • Plan a cluster only when one node cannot handle the load; clustering adds coordination and certificate work.

NiFi logs are also worth collecting centrally, as described in the centralized logging guide. Explore more data tooling in DevOps and Data Tools and step-by-step explainers in the Guides section, or go back to Mintopsblog.com for the full list.

Sizing and Running NiFi

NiFi runs on Java, so the JVM heap size in bootstrap.conf is the first setting to review. Large FlowFile content is kept on disk, not in memory, but many small FlowFiles and big attribute maps do consume heap. Watch the summary page and the bulletin board for warnings, and keep an eye on queue sizes, which show where a flow is slowing down. Older blog tutorials, including several Mintopsblog.com articles on NiFi clustering and LDAP, were written for the 1.x series; NiFi 2.x changed requirements such as the Java version and removed some deprecated processors, so always compare a tutorial with the documentation for your release.

Start small: one node, a few flows, clear naming for every processor and process group. Good names and comments on the canvas save hours when someone else has to fix a flow at night.

Frequently Asked Questions

Is Apache NiFi Free?

Yes. Apache NiFi is open-source software released under the Apache License 2.0, so you can download, run and modify it at no cost. You still pay for the servers, storage and staff time it needs, and some companies sell commercial support or managed platforms built on top of it.

What Is a FlowFile in NiFi?

A FlowFile is the unit of data that moves through a NiFi flow. It has content, such as a file or a message body, and attributes, which are key-value pairs like filename or a custom ID. Processors use attributes for routing decisions and change content when they transform data.

Does NiFi Replace an ETL Tool?

NiFi covers much of what ETL tools do, especially ingestion, routing, light transformation and delivery. For heavy joins, aggregations or complex analytics, teams often pair it with a database, Spark or a data warehouse. NiFi then handles moving data reliably while the other tool handles the heavy processing.

What Is Back Pressure in NiFi?

Back pressure is a limit on each connection queue, set by object count or data size. When a queue reaches the limit, NiFi pauses the processor feeding it until space frees up. This stops a slow destination from causing memory or disk exhaustion and keeps the rest of the flow stable.

Search
Start With the Mintopsblog.com Guide

See every topic on one page: Linux, DevOps and data tools, security and SSL, and how to use older tutorials safely.

Related Articles