DAG
A Directed Acyclic Graph, or DAG, is a concept from mathematics and computer science that describes a specific type of graph.
- Directed: Connections between points in the graph, known as nodes, have a direction. In a directed graph, each connection, or edge, points from one node to another, indicating a one-way relationship.
- Acyclic: There are no cycles in the graph. A cycle occurs when you can start at one node and follow a path of edges that eventually loops back to the starting node. In a DAG, loops are not allowed.
- Graph: A graph is a collection of nodes, which can represent tasks, events, or states, and edges, which represent relationships between those nodes.
Key Characteristics of a DAG
- Directionality: Each edge has a direction, showing the relationship from one node to another.
- No Cycles: Once you have left a node, you cannot return to it through the edges.
- Topological Ordering: Because a DAG has directed edges and no cycles, you can list the nodes in a linear order. This order respects the direction of the edges, meaning for every directed edge from node A to node B, A appears before B in order.
Common Uses
Directed acyclic graphs are useful when tasks must run in a specific order.
When working in Coalesce, you use a DAG to build your pipeline. In the graph you have nodes and the connections between them. Each connector is one way, so the first nodes execute, followed by the next nodes. CUSTOMER > STG_CUSTOMER > DIM_CUSTOMER.
