Module 09 · Lesson 2 of 9Detailed study · about 18 min

Read a NiFi flow: processors, queues and back pressure

A flow connects processing steps. Queues hold work between steps so a slow destination does not require every source request to finish immediately.

Understand the idea

Think of a parcel sorting line. One worker receives parcels, another sorts them and another delivers them. In a flow, processors do those jobs and queues are the waiting areas. A FlowFile is not necessarily one database row: it may represent a file or a batch.

Key ideas in simple English
ConceptWhat it means
ProcessorPerforms a step such as fetching, routing or writing.
FlowFileA unit of flow data with content and attributes.
Connection queueWork waiting for its next step.
Back pressureLimits upstream work when queues reach configured thresholds.

A concrete example

Think of a parcel sorting line. One worker receives parcels, another sorts them and another delivers them. In a flow, processors do those jobs and queues are the waiting areas. A FlowFile is not necessarily one database row: it may represent a file or a batch.

Remember: Locate the bottleneck before changing concurrency; faster collection can make an existing backlog worse.

Explain it step by step · full theory

Understand the idea

Think of a parcel sorting line. One worker receives parcels, another sorts them and another delivers them. In a flow, processors do those jobs and queues are the waiting areas. A FlowFile is not necessarily one database row: it may represent a file or a batch.

Attributes describe the work, while content carries the payload. A document identifier can help route a file; the file bytes are the actual content. Configuration and credentials belong in appropriate protected settings, not copied into every document.

Apply it carefully

When the writer becomes slow, adding more source readers can increase the backlog. Inspect queue count, queued bytes, oldest work, processor failures and destination throughput together. Back pressure is a protective limit, not a repair for bad credentials.

The SQL below is a small diagnostic model. It is not Openflow telemetry and its thresholds are illustrative. A real operator must inspect runtime flow metrics and logs, then identify the first constrained stage.

Words used in this lesson
Processor
Performs a step such as fetching, routing or writing.
FlowFile
A unit of flow data with content and attributes.
Connection queue
Work waiting for its next step.
Back pressure
Limits upstream work when queues reach configured thresholds.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 2

Read a NiFi flow: processors, queues and back pressure

Fetch processor
Queue + back pressure
Write processor

Follow the flow

A flow connects processing steps. Queues hold work between steps so a slow destination does not require every source request to finish immediately.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Follow the flow

    A flow connects processing steps. Queues hold work between steps so a slow destination does not require every source request to finish immediately.

  2. Find the boundary

    The SQL below is a small diagnostic model. It is not Openflow telemetry and its thresholds are illustrative. A real operator must inspect runtime flow metrics and logs, then identify the first constrained stage.

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.

Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →

Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.

Before running this lesson

SQL practice is manual. The website does not connect to external services. Connector deployment is a separate administrator-assisted exercise.

Hands-on SQL: Read a NiFi flow: processors, queues and back pressure

SQL · example
WITH queues(STEP,QUEUED_ITEMS,OLDEST_MINUTES) AS (
 SELECT * FROM VALUES ('Fetch',0,0),('Write',240,18),('Reject',3,4)
)
SELECT *, CASE WHEN OLDEST_MINUTES >= 10 THEN 'INVESTIGATE'
 ELSE 'WITHIN LAB THRESHOLD' END AS ACTION FROM queues ORDER BY STEP;

What to expect and why

Write is flagged. This shows where to investigate, not why it is slow. The three rejected items also need separate review.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

The write queue keeps growing. What should you do first?

Try it yourself

Explain your decision: The write queue keeps growing. What should you do first?

Compare your reasoning

Locate the bottleneck before changing concurrency; faster collection can make an existing backlog worse.

Official sources and curriculum

Module 09 · See module scope