
Summary: This lesson introduces the Delta architecture, which is fundamental to many Databricks systems, including Lakeflow Declarative Pipelines. It covers key concepts such as Delta Lake, Unity Catalogue, and the Medallion architecture. The Medallion architecture is detailed, highlighting the purpose and characteristics of each data zone: Bronze, Silver, and Gold.
Learning objectives:
Understand the role and function of Delta Lake technology in Databricks.
Learn about Unity Catalog and its hierarchical structure for centralized data governance.
Comprehend the Medallion architecture and the distinctions between Bronze, Silver, and Gold data zones.
Recognize how batch and streaming data processes are unified in Databricks using the Delta architecture.
Gain familiarity with key terms and concepts that will be used throughout the Lakeflow Declarative Pipelines course.
Set up your Databricks environment, Unity catalog, and Azure Event Hubs to repeat the pipelines, import code from GitHub, configure bronze and silver schemas and data volumes, and prepare notebooks.
Summary: This lesson introduces LakeFlow Declarative Pipelines, a powerful and flexible platform for building data ingestion and transformation pipelines quickly, using Python (focus of the course) or SQL. It covers the core concepts, capabilities, and components of declarative pipelines, including streaming tables, materialized views, views, flows, and pipeline orchestration. It emphasizes practical hands-on experience by encouraging learners to create and experiment with their own pipelines.
Learning objectives:
- Understand the overview and capabilities of LakeFlow Declarative Pipelines.
- Learn key declarative pipeline concepts: streaming tables, materialized views, views, flows, and pipelines.
Summary: This lesson introduces LakeFlow Declarative Pipelines, a powerful and flexible platform for building data ingestion and transformation pipelines quickly, using Python (focus of the course) or SQL. The lesson demonstrates how to enable and navigate the pipeline editor UI in Databricks, create a simple declarative pipeline, run and monitor pipeline execution, and configure pipeline settings such as scheduling, parameters, and code management. It emphasizes practical hands-on experience by encouraging learners to create and experiment with their own pipelines.
Learning objectives:
-Enable and navigate the declarative pipeline editor UI in Databricks.
-Create and run a simple declarative pipeline using Python.
- Interpret pipeline execution progress and metrics via the pipeline graph and details panels.
- Explore pipeline execution options, including dry run, development vs production mode, and full table refresh.
- Configure pipeline settings such as default catalog/schema, scheduling (simple and advanced), notifications, and compute options.
- Manage pipeline code structure by adding, including, or excluding code folders and files.
- Pass parameters to pipelines and understand their usage in Python and SQL pipelines.
- Gain confidence to experiment with declarative pipelines in Databricks for practical learning.
Summary:
This lesson provides an introduction to streaming tables in Lakeflow Declarative Pipelines on Databricks. It covers the purpose, use cases, benefits, and limitations of streaming tables. The lesson includes a detailed walkthrough of the project structure, sample data generation, and step-by-step creation of streaming tables with basic and advanced configurations. It demonstrates how to apply transformations, use schema attributes, and leverage the declarative nature of pipelines for incremental data processing. The lesson concludes with a demonstration of the incremental nature of streaming tables and how to manage temporary versus permanent tables.
Learning objectives:
- Understand the purpose and key benefits of streaming tables, including incremental processing and low latency.
- Learn the main use cases and supported data sources and destinations for streaming tables.
- Explore the syntax and key attributes for defining streaming tables in declarative pipelines.
- Gain hands-on experience with project setup, sample data generation, and pipeline folder structure.
- Create simple and complex streaming tables with schema definitions and comments.
- Apply data transformations and schema optimizations in streaming pipelines.
- Understand how declarative pipelines manage table relationships and execution order automatically.
- Demonstrate the incremental nature of streaming tables by ingesting additional data.
- Learn about temporary streaming tables and their behaviour in Unity Catalog.
Explore declarative lakeflow pipelines in Databricks by building streaming tables across bronze and silver zones, using auto loader, sema attributes, and incremental data ingestion.
Summary: This lesson in the Lakeflow Declarative Pipelines (Databricks) course focuses on ingesting event data from Azure Event Hubs into a streaming pipeline. It introduces Azure Event Hubs as a scalable streaming service similar to Kafka, used for receiving and temporarily storing large volumes of event data from various applications. The lesson covers setting up Azure Event Hubs, including creating namespaces, event hubs, and shared access policies for secure data ingestion. It then demonstrates how to build a declarative pipeline that reads streaming data from Event Hubs, applies light transformations, such as adding ingestion timestamps, and writes the data to bronze zone streaming tables. Further steps include converting binary payloads to human-readable JSON format, flattening nested JSON structures for easier consumption, and filtering business-relevant data for the silver layer. The lesson also notes that while Event Hubs can be a data source or destination, typical use involves ingesting and transforming data for downstream applications. The session concludes with a summary of the pipeline creation and data processing steps.
Learning objectives:
- Understand the purpose and functionality of Azure Event Hubs as a streaming service.
- Learn how to configure Azure Event Hubs, including namespaces, event hubs, and shared access policies.
- Build a Lakeflow declarative streaming pipeline to ingest event data from Azure Event Hubs and Kafka.
- Apply basic transformations to streaming data, including adding metadata and converting binary payloads to JSON.
- Flatten nested JSON event payloads into tabular format for business use.
- Recognize typical scenarios for using Azure Event Hubs as a data source in declarative pipelines.
- Gain practical experience running and validating streaming pipelines with sample event data.
Summary: This lesson in the Lakeflow Declarative Pipelines (Databricks) course focuses on the challenges and limitations of streaming tables in Spark Structured Streaming, along with practical solutions and best practices. It covers key streaming concepts such as time-window aggregations, handling out-of-order events with watermarking, and stateful transformations, including joins and aggregations. The lesson also demonstrates how to implement stream-to-batch and stream-to-stream joins, and highlights supported versus unsupported aggregation types. Through demos, it illustrates how to build effective streaming pipelines, manage late-arriving data, and optimize performance while avoiding common pitfalls.
Learning objectives:
- Understand the challenges and limitations inherent in streaming tables based on Spark Structured Streaming.
- Learn about time window aggregation techniques to handle global transformations efficiently.
- Explore the concept of watermarking to manage late-arriving or out-of-order events in streaming data.
- Gain awareness of considerations when implementing stateful transformations such as joins and aggregations.
- Discover best practices for creating streaming tables, including the use of watermarks and time interval matching in joins.
- Learn how to handle unsupported transformations by adjusting pipeline design or using materialized views.
- Apply knowledge through demos on stream-to-batch joins, stream-to-stream joins with watermarking, and time-based aggregations.
Demonstrate streaming table limitations and stateful transformations with joins and watermarking. Explore time-based and global aggregations on stock and accident data, and note unsupported pivots, rankings, and materialized views.
Summary: This lesson on Lakeflow Declarative Pipelines (Databricks) focuses on data quality controls within declarative pipelines. It covers the definition and use of expectations to enforce data quality, including flexible conditions and actions when data quality rules are violated. The lesson demonstrates how to build simple and composite data quality controls, apply standard database constraints like primary keys and foreign keys using these controls, and implement a quarantine mechanism to separate valid data from irregular or bad data. Practical demos illustrate how to apply these concepts in streaming tables and materialized views, showing how to monitor and handle data quality violations effectively.
Learning objectives:
- Understand the key components of data quality controls in declarative pipelines.
- Learn the syntax and usage of data quality controls.
- Differentiate between types of data quality controls (simple vs. composite).
- Build simple and composite data quality controls in pipelines.
- Use data quality controls to implement traditional database constraints such as primary keys and foreign keys.
- Implement a quarantine mechanism to filter out and analyze irregular or invalid data.
- Gain hands-on experience with data quality controls in streaming and materialized views within Databricks declarative pipelines.
Learn data quality controls in declarative pipelines, using simple and composite expectations and actions to enforce primary and foreign key constraints on Delta Lake tables across bronze and silver.
Summary: This lesson on Lakeflow Declarative Pipelines (Databricks) focuses on materialized views as a solution to the limitations of streaming tables, especially for handling more complex transformations. It explains what materialized views are, their advantages, and best use cases, particularly for batch ingestion. The lesson covers the syntax for using materialized views within declarative pipelines and demonstrates how to create end-to-end pipelines combining streaming tables and materialized views. It highlights the ability to include aggregations and joins in materialized views and discusses their incremental processing nature. The lesson concludes by showing practical examples and execution results, emphasizing that materialized views are suitable when latency is less critical and more complex transformations are needed.
Learning objectives:
- Understand the overview and purpose of materialized views.
- Learn the advantages and best use cases for materialized views.
- Identify sources and destinations compatible with materialized views.
- Explore the syntax for defining materialized views in declarative pipelines.
- Build end-to-end pipelines that integrate streaming tables and materialized views.
- Apply complex transformations such as joins and aggregations within materialized views.
- Examine the incremental processing capabilities of materialized views.
Summary: This lesson covers best practices for materialized views in Lakeflow Declarative Pipelines on Databricks. It begins with an overview of suitable data sources, highlights which sources to avoid, emphasizes the importance of incremental refresh to enhance performance, and explains how to encourage its use by running pipelines on serverless compute and applying specific optimization attributes.
Learning objectives:
Understand best practices for materialized views in Databricks.
Identify data sources that are suitable or unsuitable for materialized views.
Learn about incremental refresh and how it improves materialized view performance.
Discover how to encourage incremental refresh by using serverless compute and optimization attributes.
Explore optimization attributes such as deletion vectors, row tracking, and change data feed.
Demonstrate how materialized view optimization settings enable incremental refresh in a declarative Lakeflow pipeline using deletion vectors, road tracking, and change data feed.
Summary:
This lesson in the Lakeflow Declarative Pipelines (Databricks) course focuses on the concept of flows, which are the internal mechanisms responsible for moving data between different objects in declarative pipelines. It explains that flows can be implicitly created by the system when defining streaming tables or explicitly defined by the user. The lesson highlights the benefits of flows, such as the ability to populate a single table from multiple sources, handle transactional data, and write to external destinations like Delta Lake tables, Event Hub, or Kafka. Two main types of flows are discussed: append flows for immutable or additive data sources, and AutoCDC (Change Data Capture) flows for ever-changing transactional data. The lesson includes demonstrations of implicit flows in streaming pipelines and explicit append flows, including a practical example of combining historical and real-time data ingestion into the same table using append flows with backfilling.
Learning objectives:
- Understand what flows are and their role in declarative pipelines.
- Learn the difference between implicit and explicit flows.
- Recognize the benefits and flexibility of using flows in data pipelines.
- Identify the two main types of flows: Append and AutoCDC.
- Learn how to create Append flows to ingest data from multiple sources into a single target table.
- Understand how to handle historical data ingestion alongside real-time data using flows with backfilling.
- Gain practical experience by reviewing example code and running pipelines that demonstrate flow usage.
Summary:
This lesson on Lakeflow Declarative Pipelines focuses on Auto CDC (Change Data Capture) flows, which enable ingestion of data from constantly changing data sources such as tables. It covers the concept of CDC, its data format, and the two main flavours of Auto-CDC flows: CDC and snapshots (with emphasis on CDC in this lesson). The lesson includes a practical demonstration of preparing CDC data, creating Auto CDC flows, and exploring different destination table write modes (Slowly Changing Dimension Type 1 and Type 2). The demo uses Delta Lake tables with Change Data Feed enabled to track changes and shows how to build pipelines that apply these changes to target tables. The lesson concludes with a summary of key points and a note on shutting down streaming pipelines to avoid unnecessary charges.
Learning objectives:
- Understand the overview of Auto CDC flows and their best use cases, advantages, and data sources.
- Learn the syntax and key attributes for creating Auto CDC flows in Lakeflow Declarative Pipelines.
- Prepare CDC data suitable for ingestion by Auto CDC flows.
- Create AutoCDC flows using CDC data sources.
- Explore and differentiate between destination table write modes: Slowly Changing Dimension (SCD) Type 1 (overwrite) and Type 2 (history tracking).
- Gain practical experience through a demo involving Delta Lake tables with Change Data Feed and streaming pipelines.
- Recognize the importance of managing streaming pipelines to control costs.
Summary:
This lesson on Lakeflow Declarative Pipelines focuses on a specific type of Auto CDC flow that ingests data from snapshots rather than from change data capture engines. It covers the concept of Auto CDC from snapshots, explaining how snapshot data can be generated and ingested, the required data format, and the advantages of this approach. The lesson includes a detailed walkthrough of the syntax and usage of Auto CDC from snapshot flows, including how to create and use lambda functions as data sources. It also demonstrates building pipelines with different destination table write modes (SCD type one and two) and explains how history tracking works in these scenarios. The lesson concludes with a demo that generates sample snapshot data, builds Auto CDC pipelines, and explores the resulting data in destination tables.
Learning objectives:
- Understand the overview of auto CDC from snapshot flows.
- Learn the best use cases and advantages of using snapshot-based auto CDC.
- Identify the acceptable input data shapes for snapshot ingestion.
- Understand the syntax and key attributes for creating auto CDC from snapshot flows.
- Learn how to create and use lambda functions as sources for snapshot data.
- Explore different destination table write modes (SCD type one and two) and their effects on data history. - Gain practical experience by generating sample snapshot data and building auto CDC pipelines in a demo.
Summary:
This lesson on Lakeflow Declarative Pipelines focuses on Declarative Pipeline sinks, which enable communication of data from declarative pipelines to external destinations. The lesson covers an overview of sinks, their advantages, use cases, and different types available, including Delta Lake sinks, Kafka sinks, ForEachBatch sinks, and Python Custom sinks. It explains the syntax for creating these sinks and demonstrates their usage through examples, writing data to Delta Lake tables, Azure Event Hubs (Kafka), and multiple destinations using ForEachBatch sinks. The lesson highlights how sinks facilitate writing streaming and batch data to various external systems, overcoming challenges with native declarative data objects. Practical demos show how to configure sinks, define append flows, and handle micro-batches in streaming data.
Learning objectives:
- Understand what Declarative Pipeline sinks are and why they are needed.
- Learn the different types of sinks available in Lakeflow Declarative Pipelines.
- Gain knowledge of the syntax for creating and configuring Delta Lake, Kafka, and ForEachBatch sinks.
- Explore how to write data from declarative pipelines to external destinations such as Delta Lake tables and Azure Event Hubs.
- Learn how to implement batch handlers for custom logic in ForEachBatch sinks.
- See practical demonstrations of sinks in action, including data transformations and writing to multiple destinations.
- Understand how to manage connection settings and options for sinks, including security considerations like using Azure Key Vault for secrets.
Summary: This lesson covers the compute options available for Lakeflow declarative pipelines in Databricks. It explains the two types of compute: serverless and classic. Serverless compute is a managed, auto-scaling option that starts quickly and requires minimal configuration, with an optional budget policy for cost tracking. Classic Compute offers more control, allowing users to configure cluster size, auto-scaling, node types, and add tags or policies for cost management. The lesson also demonstrates how to configure these compute options through the settings page, highlighting the differences and practical steps for setup.
Learning objectives:
Understand the two compute types available for declarative pipelines: serverless and classic.
Learn the benefits and characteristics of serverless compute, including auto-scaling and quick start.
Learn how to configure classic compute clusters, including auto-scaling options, node sizing, and tagging.
Gain practical knowledge on how to set up and manage compute configurations within the declarative pipeline settings.
Understand the use of budget policies and tags for cost tracking in both compute types.
Summary: This lesson covers the security setup required for Lakeflow Declarative Pipelines in Databricks. It explains user access levels for running and monitoring pipelines, the concept of pipeline identities (run-as accounts), and the permissions needed for these identities when deploying pipelines across environments. The lesson includes a demo on granting user access, creating and configuring Databricks Managed Service Principals as pipeline identities, setting appropriate permissions at workspace and Unity Catalog levels, and changing the pipeline's run-as account.
Learning objectives:
Understand different user access levels for declarative pipelines (owner, can manage, can run, can view).
Learn about pipeline identities and why service principals are recommended for running pipelines in production environments.
Know the types of service principals available: Databricks Managed and Microsoft Entra Managed.
Identify the necessary permissions for pipeline identities at workspace and Unity Catalog levels, including cluster creation and catalog/schema/table access.
Gain practical experience in granting user access, creating service principals, configuring their permissions, and updating pipeline run-as accounts.
Summary: This lesson covers the orchestration options for Lakeflow Declarative Pipelines in Databricks. It explains that while pipelines are often manually triggered during development, automated orchestration is essential for test and production environments. The lesson reviews three common orchestration methods: native pipeline orchestration via the pipeline editor, Databricks jobs, and third-party tools like Apache Airflow and Azure Data Factory, all of which use declarative pipeline APIs. It also highlights the importance of pipeline retry configuration to handle transient errors. The lesson then discusses pipeline scheduling methods, distinguishing between triggered mode and continuous mode.
Learning objectives:
Understand the need for automated orchestration of declarative pipelines beyond manual triggering.
Learn about the main orchestration options available for declarative pipelines in Databricks, including native orchestration, Databricks jobs, and third-party tools.
Recognize the role of pipeline retry configuration in ensuring pipeline resilience.
Differentiate between triggered and continuous pipeline execution modes.
Understand the differences between event-based and trigger-based continuous execution modes.
Prepare to apply orchestration techniques using Databricks tools in practical scenarios.
Learn to orchestrate declarative pipelines in Databricks by choosing continuous or trigger modes, scheduling options, and integrating with Databricks jobs for multi-pipeline workflows.
Summary: This lesson covers the deployment process of declarative pipelines in Databricks using Databricks Asset Bundles (DABs). It introduces the basics of Databricks DevOps, emphasizing source control integration, typical DevOps cycles, and deployment packaging. The lesson explains what DABs are, their YAML-based configuration, and how they facilitate deployment across environments. It demonstrates creating and managing DABs within a Git-enabled workspace, adding code artifacts, configuring pipeline definitions, and deploying to multiple environments. The lesson also shows how to locate deployed pipelines and code artifacts in the Databricks workspace.
Learning objectives:
Understand the role of source control in Databricks DevOps and how to enable it.
Learn the typical steps of the DevOps cycle for declarative pipeline deployment.
Gain knowledge of Databricks Asset Bundles (DABs) as a YAML-based deployment tool.
Learn how to create and configure DABs, including setting up environments, variables, and resources.
Understand how to add declarative pipeline code artifacts to DABs.
Learn how to deploy DAB packages to different environments.
Know where to find deployed pipelines and associated code artifacts within the Databricks workspace.
Gain practical insights through a demonstration of creating, configuring, and deploying declarative pipelines using DABs.
Summary: This lesson provides an overview of monitoring LakeFlow declarative pipelines in Databricks. It addresses two main questions: what to monitor in declarative pipelines and what tools and methods to use for monitoring. Key monitoring targets include pipeline execution events, ETL statistics, data quality statistics, streaming metrics, and job/task durations. The lesson categorizes monitoring tools into interactive tools available via Databricks portals (such as Pipeline Editor UI, Jobs and Pipelines UI, and Query History) and programmatic methods (querying event logs, configuring alerts, and using custom event hooks). It also explains how to use event logs effectively for troubleshooting and monitoring multiple pipelines, and introduces event hooks as a powerful way to automate responses to pipeline events.
Learning objectives:
Understand the key objects, events, and metrics to monitor in LakeFlow declarative pipelines.
Learn about different categories of monitoring tools and methods available in Databricks.
Gain knowledge on how to use interactive UIs for pipeline monitoring.
Learn how to query event logs programmatically to troubleshoot and analyze pipeline performance.
Understand how to configure alerts for pipeline events and custom data conditions.
Explore the use of event hooks to automate actions based on pipeline events and conditions.
Explore interactive and programmatic monitoring of declarative pipelines in Databricks, including backlog metrics, unified run lists, query history, event logs, and alerting through notifications and event hooks.
This course offers a practical, comprehensive guide to Lakeflow Spark Declarative Pipelines (formerly known as Delta Live Tables or DLT) on Databricks, covering the full lifecycle from development to deployment and monitoring.
Learners are introduced to the core building blocks of Declarative Pipelines, such as streaming tables, materialized views, flows, and sinks. Limitations of streaming tables and materialized views are explained, alongside the best practices on designing these components.
The data quality control topic demonstrates the quality expectation controls, allowing for flexible data quality conditions and enforcement actions.
The flows and sinks topics explain various flow types, including Auto CDC and Snapshot flows, and demonstrate how Declarative Pipelines can write data to external systems, like Delta Lake tables, streaming services and custom destinations.
The Declarative Pipelines management topics cover compute, orchestration,deployment and security tools. Security setups are covered in detail, including user access levels, pipeline identities, and permissions required for secure operation across environments.
Monitoring topics explain events and metrics requiring monitoring, as well as various interactive and programmatic monitoring tools available in Databricks.
The course includes multiple quizzes to validate students' knowledge. A capstone project provides students with an opportunity to test their knowledge by building an end-to-end Lakeflow Spark Declarative Pipeline using an open-source dataset.
The students will learn an advanced declarative pipeline development approach and prepare for real-time streaming-related topics that are part of the Databricks Data Engineering Professional exam path.