cancel
Showing results for 
Search instead for 
Did you mean: 
Technical Blog
Explore in-depth articles, tutorials, and insights on data analytics and machine learning in the Databricks Technical Blog. Stay updated on industry trends, best practices, and advanced techniques.
cancel
Showing results for 
Search instead for 
Did you mean: 
tapash-db
Databricks Employee
Databricks Employee

Introduction

This blog explores Lakeflow Connect, a tool designed to simplify and streamline data ingestion from databases like SQL Server into Databricks. It addresses common challenges associated with traditional SQL Server data integration, such as complex configurations, performance bottlenecks, and security risks. The blog then provides an overview of the connector's components.

 

Lakeflow Connect empowers users to focus on data analysis rather than the complexity of building the pipeline, enhancing the time to value for data analysis.

 

Challenges in Data Ingestion w/ SQL Server 

Ingesting data from Microsoft SQL Server comes with several challenges that impact efficiency, scalability, and performance. Establishing and maintaining ODBC, JDBC, or ADO.NET connections requires precise configuration, with authentication mechanisms like Kerberos and Active Directory adding complexity. Network security, driver updates, and minimizing the load on source systems further complicate maintenance.

Many SQL Server ETL tasks, such as query optimization, managing SQL Agent jobs, or configuring linked servers, require specialized expertise from DBAs and data engineers. This dependency often creates bottlenecks, slowing down data pipelines and limiting agility. Large extractions that use inefficient queries can impact performance, leading to blocking, deadlocks, and disruptions.  

Incremental data processing presents another challenge. Properly configuring Change Data Capture (CDC) and Change Tracking is critical for capturing updates efficiently, but a poor setup can lead to bloated transaction logs and excessive TempDB usage. Schema drift adds further complexity, as changes in table structures or SQL Server-specific data types like NVARCHAR(MAX), DATETIMEOFFSET, and IMAGE can break ingestion pipelines if not handled correctly.

Security and compliance risks are also a concern. Staging data for ingestion increases exposure, especially when Transparent Data Encryption (TDE), row-level security, or column masking is in place. Inadequate access controls can lead to compliance violations. Additionally, ensuring data quality remains a challenge, as issues like NULL handling, failed transactions, and identity column mismatches can cause ingestion failures, resulting in inconsistent analytics.

How Lakeflow Connect Addresses These Challenges 

Lakeflow Connect automates SQL Server data ingestion, reducing complexity and improving reliability. By streamlining connection setup, authentication, and driver management, it eliminates many of the manual configuration challenges. Its self-service tools reduce dependency on DBAs and data engineers, allowing teams to move data more efficiently.

Performance is optimized through CDC support and query tuning, preventing unnecessary strain on SQL Server while ensuring smooth incremental processing. The platform dynamically adapts to schema changes and accurately maps SQL Server-specific data types, preventing ingestion failures and maintaining data integrity.

Security is reinforced with Databricks Unity Catalog(UC) integration, ensuring governance and compliance with enterprise security standards. Additionally, built-in mechanisms improve data quality by consistently capturing updates, gracefully handling ingestion failures, and minimizing risks related to dirty or incomplete data.

By automating ingestion, incrementally processing data to reduce system load on SQL Server, and maintaining high-quality data pipelines, Lakeflow Connect makes SQL Server data integration seamless and scalable.

 

Getting Started with Lakeflow Connect SQL Server 

Lakeflow is compatible with Azure SQL Databases and Amazon RDS SQL Databases. Based on Databricks’ provided networking, the connector can work with On-Prem SQL Server and SQL Server running on VMs in Azure or AWS.

 

Components

The Lakeflow Connect SQL Server connector includes three main components: Connection, Ingestion Gateway, and Managed Ingestion, as illustrated below.

tapashdb_0-1750730417624.png

The connection object is secured by Unity Catalog and stores the authentication details for the database.  Where OAuth or Credentials (User Name & Password) can be leveraged to connect.  Connections can be found in the Catalog Explorer -> External Data -> Connections.

 

The ingestion gateway leverages Classic Compute to Stage Snapshots, Change Logs, and associated metadata into a Databricks Volume that the Managed Ingestion Pipeline reads from. In the illustration below, this is what is referred to as the Internal State.  This volume is purged after 25 days and removed permanently after 30 days.

 

What is captured in the Volume includes:

  • Backup(s)
  • CDC data files (JSON)
  • Manager - task configs from ingestion pipelines (JSON)
  • Metadata - table schema, CDC metadata, snapshot metadata
  • Snapshot -  table snapshots (parquet)
  • Telemetry - logs and metrics (JSON)

 

The Managed Ingestion Pipeline is a pipeline that takes snapshots and change logs from the Staging Location and merges them into a Streaming Table.  It leverages Auto Loader to efficiently read changes from the Staging Volume for CDC and Snapshot files.

Prerequisites

  • Enabling change tracking or change data capture with the SQL Server Connector is a requirement for an efficient, performant pipeline. Databricks recommends Change Tracking where supported (i.e., tables with primary keys) for optimal performance, reserving CDC for scenarios where detailed historical data is required or where no primary key is present.
  • Read access to system tables and views on the master database.  Execute permissions on system stored procedures from the source database. Select permissions on the source database.
  • Change Tracking Requires SQL Server 2012 or Above
  • CDC requires SQL Server 2012 or Above, and anything earlier than 2016 requires Enterprise licensing.  See here for more details.

 

Step by Step Guide

Within a few steps, an Ingestion Gateway and Pipeline are provisioned and optimized to incrementally introduce changes based on business requirements into Streaming Tables.

Here is an overview of the steps to provision the Managed Ingestion Pipeline. Plans are in place to support Databricks Asset Bundles (DABs) with Lakeflow Declarative Pipelines to provision these pipelines through Infrastructure-as-code tooling.

Data Ingestion in Menu 
Ingestion Gateway

tapashdb_0-1751048912454.png

 

Ingestion Pipeline

tapashdb_1-1751048912482.png

 

Gateway Provisioning

The cluster will connect to the SQL Server instance to provide a view of the data to be ingested.  Select what source is needed.

tapashdb_2-1751048912472.png

 

Scheduling & Alerting 

Define scheduling and alerting after selecting the destination catalog and schema.

 

tapashdb_3-1751048912483.png

 

Pipeline Run

After the run the tables are ready for querying

 

tapashdb_4-1751048912492.png

 

Conclusion 

In this blog, we showcased how Databricks Lakeflow Connect seamlessly integrates with SQL Server and simplifies the data ingestion process while enforcing the security powered by Unity Catalog. By leveraging Lakeflow Connect, organizations can efficiently ingest data from SQL Server into the Databricks Lakehouse. With incremental data ingestion, serverless compute, and unified monitoring, Lakeflow Connect not only accelerates data availability for analytics and AI but also upholds enterprise-grade governance at every step of the pipeline.

In summary, Lakeflow Connect is a powerful solution for simplifying and optimizing SQL Server data integration with Databricks. If your goal is to modernize data pipelines, improve efficiency, and unlock the full potential of your data, Lakeflow Connect is a compelling choice.

1 Comment