Azure Data Factory Design Patterns

Azure Data Factory Design Patterns

Watch the video to deepen your understanding.

Subscribe

Complete the full lesson to earn 25 points

Work through each section, then tap β€œMark as Complete” on the last one.

Section 1 of 2

✦ Skip the page breaks and see fewer ads β€” read each lesson on a single page with Pro

Lesson: Azure Data Factory (ADF) Design Patterns

1. Introduction

In modern data engineering, building robust, scalable, and maintainable data pipelines is critical. Azure Data Factory (ADF) is a cloud-based ETL and data integration service that allows you to create data-driven workflows for orchestrating data movement and transforming data at scale.

However, simply connecting sources to sinks is insufficient for enterprise-grade solutions. Design Patterns are reusable solutions to commonly occurring problems in pipeline architecture. By adopting established patterns, you reduce development time, improve reliability, and ensure your data integration layer can handle the complexities of evolving business requirements.


2. Core ADF Design Patterns

A. The "Metadata-Driven" Pipeline Pattern

Instead of hardcoding pipeline activities for every table or file, the metadata-driven pattern uses a control table (stored in Azure SQL or Cosmos DB) to define the scope of data movement.

How it works:

  1. A Lookup activity queries a database table containing source/sink metadata (e.g., table names, schema, watermarks).
  2. A ForEach activity iterates through the list of tables.
  3. Inside the loop, an Execute Pipeline or Copy Activity uses dynamic expressions to map the metadata to the connection strings or file paths.

Example Dynamic Expression: If you are iterating through a list of tables, you can dynamically reference the source table in your Copy Activity source dataset:

// Dynamic expression for source table name
@item().SourceTableName

B. The "Incremental Load" (Watermark) Pattern

Loading full datasets every day is inefficient and costly. The Incremental Load pattern ensures only new or modified data is processed.

How it works:

  1. Lookup Old Watermark: Fetch the last processed timestamp from a control table.
  2. Lookup New Watermark: Fetch the MAX(LastModifiedDate) from the source system.
  3. Copy Activity: Use a query filter: SELECT * FROM Orders WHERE LastModifiedDate > '@{activity('OldWatermark').output.firstRow.WatermarkValue}' AND LastModifiedDate <= '@{activity('NewWatermark').output.firstRow.NewValue}'.
  4. Stored Procedure: Update the control table with the new watermark value.

C. The "Hub-and-Spoke" Orchestration Pattern

In large organizations, you often have a "Master" pipeline that triggers "Child" pipelines. This promotes modularity.

  • Master Pipeline: Handles global logic, such as error logging, variable initialization, and controlling the sequence of execution.
  • Child Pipelines: Perform specific, reusable tasks (e.g., "Ingest Salesforce Data," "Clean Customer Dim," "Archive Logs").

Section 1 of 2
PrevNext