liveBook · Manning

Directed acyclic graph

As explained in Architecting an Apache Iceberg Lakehouse

A directed acyclic graph is a graph of nodes and directed dependencies with no cycles, commonly representing workflow tasks and their execution order.

A directed acyclic graph (DAG) models a workflow as one-way task dependencies without loops. Each task waits for its prerequisites, making execution order predictable, auditable, and easier to debug. section 11.1

In lakehouse maintenance, a DAG can:

  • Check Iceberg metadata and trigger compaction only when small-file or snapshot thresholds are exceeded. section 11.1
  • Enforce sequences such as compaction before snapshot expiration and orphan-file removal. section 11.1.1
  • Add retries, alerts, conditional logic, per-table parameters, and observability metrics. section 11.1.1 section 11.1.5

Metadata-aware compaction

An Airflow DAG queries an Iceberg files table, counts small files, and runs Spark's rewrite_data_files procedure only when the count exceeds 500. A separate dbt workflow can expire snapshots after transformation, while Python can publish snapshot counts to Prometheus. section 11.1.5

Figure 11.1 A directed acyclic graph (DAG) illustrates a non-looping order of tasks. In this example, tasks 2 and 3 can’t begin until task 1 is complete, and task 4 can’t begin until tasks 2 and 3 are complete. This ensures that a task doesn’t begin until all other dependent tasks are complete.

Shows a branching dependency pattern in which tasks 2 and 3 wait for task 1, and task 4 waits for both branches. section 11.1

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Defines directed dependencies and no cycles, then demonstrates conditional execution, retries, ordering, and monitoring integrations.
Examples
Uses Airflow compaction checks, dbt snapshot expiration, Spark SQL procedures, and Prometheus snapshot-count metrics.
What it assumes
Assumes Iceberg maintenance procedures and SQL execution layers, while defining DAG dependencies from first principles.
What you can do after
Operate conditional, ordered, retryable Iceberg maintenance pipelines through Airflow, dbt, or comparable orchestration tools.
How it connects
Connects workflow orchestration with Apache Airflow, dbt, Apache Spark, Iceberg metadata, compaction, snapshot expiration, and Prometheus.

Also explained in

Compare how 15 books explain directed acyclic graph →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.