Data Mart

A Data Mart is a subject-oriented analytical data store designed to support the reporting, analytics, and decision-making needs of a specific business function, department, domain, or analytical workload.

For example:

  • Sales Data Mart
  • Finance Data Mart
  • Customer Data Mart
  • Marketing Data Mart
  • Supply Chain Data Mart
  • HR Data Mart
Enterprise Data Warehouse / Lakehouse
企业中央数据平台
          |
          |---------------- Sales Data Mart
          |                  销售数据集市
          |
          |---------------- Finance Data Mart
          |                  财务数据集市
          |
          |---------------- Customer Data Mart
          |                  客户数据集市
          |
          |---------------- Marketing Data Mart
                             市场数据集市

A Data Mart typically contains curated, integrated, business-friendly data optimized for analytical queries rather than operational transactions.

What data marts actually address

What data marts actually address is: How do we turn enterprise data into a business-consumable analytical model?

The Real Value of a Data Mart

  • Business Simplification 业务简化
  • Consistent Business Definitions 统一业务定义
  • Performance 查询性能
  • Security 安全
  • Self-Service Analytics 自助分析

Data Mart vs Data Warehouse

  • Scope and Scale / 范围与规模
    • DWH: Centralizes cross-functional data across the entire enterprise. / 汇集整个企业跨部门的全局数据。
    • DM: Isolate highly specific data for teams like sales, marketing, or finance. / 仅隔离出销售、市场或财务等特定团队所需的局部数据。
  • Structural Architecture / 架构关系
    • Top-down (Inmon): The DWH is built first as a central repository, and Data Marts are extracted from it. / 自上而下架构: 先建立中央数仓,再从中抽取并生成各个数据集市。
    • Bottom-up (Kimball): Independent Data Marts are built first for business units, then integrated to form the DWH. / 自下而上架构: 先为各业务单元建立独立的数据集市,最终组合在一起构成全局数仓。
  • Speed and Performance / 速度与性能
    • DWH: Handles massive, complex analytical queries across different business domains, which can be slower. / 处理跨领域的海量复杂分析,查询可能较慢。
    • DM: Offers much faster query responses because it scans smaller, curated datasets. / 因为只扫描较小的、精选的数据集,所以查询响应速度极快。
Feature / 特性Data Warehouse (DWH) / 数据仓库Data Mart (DM) / 数据集市
Data Scope / 数据范围Enterprise-wide, cross-functional data / 汇集全企业、跨功能数据Single subject or specific department / 单一主题或特定部门
Data Sources / 数据来源Multiple operational systems and external feeds / 多个业务系统和外部数据源Mostly derived from the central warehouse / 大多衍生自中央数仓
Size / 数据容量Typically hundreds of gigabytes to petabytes / 通常为数百 GB 到 PB 级Usually less than 100 gigabytes / 通常小于 100 GB
Implementation / 实施周期Months to years to fully deploy / 全面部署需要数月到数年Days to weeks for a targeted setup / 针对性搭建仅需数天到数周
Primary Users / 主要用户Data scientists, enterprise analysts / 数据科学家、企业级分析师Department managers, local teams / 部门经理、业务团队

The Complete Data Mart Lifecycle

Business Requirements
        |
        v
Identify Business Process
        |
        v
Identify Grain
        |
        v
Identify Dimensions
        |
        v
Identify Facts
        |
        v
Source-to-Target Mapping
        |
        v
ETL / ELT
        |
        v
Data Quality
        |
        v
Data Mart
        |
        v
Semantic Layer
        |
        v
Power BI / Reporting

Where is Data Mart in Lakehouse

              Azure
                |
       +--------+---------+
       |                  |
     CRM                ERP
       |                  |
       +--------+---------+
                |
              Bronze
                |
              Silver
                |
              Gold
                |
      +---------+---------+
      |         |         |
      v         v         v
   Sales      Finance   Customer
   Mart        Mart       Mart
      |         |         |
      +---------+---------+
                |
             Power BI

The complete implementation of a data mart

assuming, we have those in Silver:

  • silver.orders
  • silver.order_items
  • silver.customers
  • silver.products

We are creating Sales Data Mart

Step 1 — Dimension

Dim Customer

-- ============================================================
-- PURPOSE:
--   Build the Customer Dimension for the Sales Data Mart.
--
-- WHY:
--   Fact_Sales will reference customer_key instead of storing
--   all customer descriptive attributes repeatedly.
-- ============================================================

CREATE TABLE gold.dim_customer
USING DELTA
AS
SELECT
    -- --------------------------------------------------------
    -- Surrogate Key
    -- --------------------------------------------------------
    -- A surrogate key is the warehouse/Data Mart key used
    -- internally by the dimensional model.
    -- --------------------------------------------------------
    monotonically_increasing_id() AS customer_key,

    -- --------------------------------------------------------
    -- Business Key
    -- --------------------------------------------------------
    -- This is the identifier coming from the source system.
    -- Example: CRM customer ID.
    -- --------------------------------------------------------
    customer_id,

    -- --------------------------------------------------------
    -- Descriptive Attributes
    -- These attributes describe the customer.
    -- --------------------------------------------------------
    customer_name,
    city,
    province,
    customer_segment

FROM silver.customers;

Product Dimension

-- ============================================================
-- PURPOSE:
--   Create the Product Dimension.
--
-- BUSINESS PURPOSE:
--   Allow analysts to slice sales by product, category,
--   brand, etc.
-- ============================================================

CREATE TABLE gold.dim_product
USING DELTA
AS
SELECT
    -- Internal surrogate key used by the Data Mart
    monotonically_increasing_id() AS product_key,

    -- Source-system business key
    product_id,

    -- Business descriptive attributes
    product_name,
    category,
    brand

FROM silver.products;

Date Dimension

-- ============================================================
-- PURPOSE:
--   Create a reusable Date Dimension.
--
-- WHY:
--   Business users frequently analyze data by:
--       Year
--       Quarter
--       Month
--       Week
--       Day
--
--   Instead of repeatedly calculating these values from the
--   transaction timestamp, we centralize the business calendar.
-- ============================================================

CREATE TABLE gold.dim_date
USING DELTA
AS
SELECT
    date,

    -- Calendar attributes
    year(date)    AS year,
    quarter(date) AS quarter,
    month(date)   AS month,
    day(date)     AS day,

    -- Useful reporting attributes
    dayofweek(date) AS day_of_week,
    date_format(date, 'MMMM') AS month_name

FROM (
    -- Generate a calendar covering the required business period.
    SELECT explode(
        sequence(
            DATE '2020-01-01',
            DATE '2030-12-31',
            INTERVAL 1 DAY
        )
    ) AS date
);

Step 2 — Fact Sales

Fact_Sales

-- ============================================================
-- PURPOSE:
--   Build the Sales Fact Table.
--
-- GRAIN:
--   One row = one order line item.
--
-- THIS IS CRITICAL.
--   We must define the grain BEFORE loading the fact table.
-- ============================================================

CREATE TABLE gold.fact_sales
USING DELTA
AS
SELECT

    -- ========================================================
    -- Dimension Foreign Keys
    -- ========================================================

    d.date_key,

    c.customer_key,

    p.product_key,

    -- ========================================================
    -- Degenerate / Business Identifiers
    -- ========================================================

    oi.order_id,

    -- ========================================================
    -- Measures
    -- ========================================================

    oi.quantity,

    oi.sales_amount,

    oi.discount_amount,

    oi.cost_amount,

    -- Profit is derived from business measures.
    -- ========================================================
    oi.sales_amount
        - oi.discount_amount
        - oi.cost_amount AS profit_amount

FROM silver.order_items oi

-- ============================================================
-- Join Customer Dimension
-- ============================================================
JOIN gold.dim_customer c
    ON oi.customer_id = c.customer_id

-- ============================================================
-- Join Product Dimension
-- ============================================================
JOIN gold.dim_product p
    ON oi.product_id = p.product_id

-- ============================================================
-- Join Date Dimension
-- ============================================================
JOIN gold.dim_date d
    ON CAST(oi.order_date AS DATE) = d.date;
                     dim_customer
                          |
                          |
                          |
dim_date ---------- fact_sales ---------- dim_product
                          |
                          |
                       dim_store

What was revenue by customer segment and month?

SELECT
    d.year,
    d.month,
    c.customer_segment,
    SUM(f.sales_amount) AS revenue
FROM gold.fact_sales f

JOIN gold.dim_customer c
    ON f.customer_key = c.customer_key

JOIN gold.dim_date d
    ON f.date_key = d.date_key

GROUP BY
    d.year,
    d.month,
    c.customer_segment

ORDER BY
    d.year,
    d.month,
    c.customer_segment;

Key Takeaways

Data Mart: A subject-oriented analytical data store designed for a specific business domain or analytical purpose.
面向特定业务领域、部门或分析需求的数据分析存储层。

ConceptWhat is it?Main Purpose
Data LakeLarge-scale flexible data repositoryStore diverse data
Data WarehouseIntegrated analytical platformEnterprise analytics
Data MartDomain-oriented analytical storeBusiness-domain analytics
LakehouseArchitecture combining lake + warehouse capabilitiesUnified data platform

For easy remember:

Data Lake: Store Data

  • Raw
  • Flexible
  • Large scale
  • Structured + Semi-structured + Unstructured

Data Warehouse: Integrate and analyze enterprise data

  • Enterprise-wide
  • Integrated
  • Structured
  • Governed
  • Historical
  • Analytics

Data Mart: Serve a specific business domain

  • Sales
  • Finance
  • Customer
  • Risk
  • Marketing
  • HR

Lakehouse: Unify Data Lake + Data Warehouse capabilities

Scalable storage
+
ACID
+
Governance
+
SQL Analytics
+
BI
+
Data Engineering
+
ML / AI

Data Lake / Warehouse / Lakehouse describe data-platform architecture;
Data Mart describes a business-oriented analytical data product or store.

Kimball Dimensional Modeling

Data Modeling include:

  • Conceptual Modeling
  • Logical Modeling
  • Physical Modeling
  • Operational Data Modeling
  • Relational Modeling
  • Data Vault
  • Dimensional Modeling
    e.g. Kimball dimensional modeling
  • Other Modeling Approaches

Dimensional Modeling is a data modeling technique designed primarily for analytical workloads.

It organizes data around:

  • Facts — measurable business events 可以度量的业务事件
  • Dimensions — descriptive business context 描述业务上下文的信息

Kimball Dimensional Modeling

Kimball Dimensional Modeling is an approach to designing analytical data warehouses using dimensional models, centered around business processes, facts, dimensions, conformed dimensions, and a bus architecture.

Kimball Dimensional Modeling belongs to Dimmensional Modeling.

The Core Philosophy of Kimball:
Start with the business process, not the database tables.

Important concept of Kimball’s dimensional modeling

Business Process

A Business Process is a business activity that an organization performs and wants to measure, analyze, and improve.
企业正在执行的一类业务活动,而且企业希望对这类活动进行度量、分析和改进. e.g.

  • 销售 Sales
  • 订单履行 Order Fulfillment
  • 库存 Inventory
  • 支付 Payments
  • 退货 Returns
  • 保险理赔 Claims
  • 医院入院 Admissions
  • 贷款申请 Loan Applications
  • 客户服务 Customer Service

Kimball dimensional modeling starts with the business process.

Typical examples of Business Processes

Retail:

  • Sales
  • Inventory
  • Returns
  • Payments
  • Shipping

Banking:

  • Account Opening
  • Transactions
  • Payments
  • Loans
  • Credit Card Transactions
  • Fraud Detection

Government

  • Application
  • Case Processing
  • Permit Issuance
  • Payment
  • Inspection
  • Appeal

Kimball Dimensional Design — 4 Steps

The four critical steps of the Kimball lifecycle / dimensional modeling methodology are:

  1. Select the Business Process
  2. Declare the Grain
  3. Identify the Dimensions
  4. Identify the Facts

An Example: “We want to analyze credit card transactions.”

Do not create tables now.

Step 1: Select the Business Process

What is the Business Process? Credit Card Transaction

What is the Business Event? A cardholder makes a transaction
at a merchant.

Step 2: Declare the Grain

What is the Grain? One row = one credit card transaction

Step 3: Identify the Dimensions

What Dimensions?

  • Customer
  • Card
  • Merchant
  • Date
  • Time
  • Location
  • Transaction Type

Step 4: Identify the Facts

What Facts?

  • Transaction Amount
  • Fee Amount
  • Tax Amount
  • Reward Points

Finally:

                  Dim Customer
                       |
                       |
Dim Card ------- Fact Transaction ------ Dim Merchant
                       |
                       |
                    Dim Date
                       |
                       |
                    Dim Time

This is Kimball’s thought.

Implementation – Initially Physical Model

Assuming, I have decided:
Grain = one row per sales order line

#  Fact
CREATE TABLE fact_sales (
    sales_date_key       INT,
    customer_key         BIGINT,
    product_key          BIGINT,
    store_key            BIGINT,

    order_number         STRING,

    quantity             DECIMAL(18,2),
    unit_price            DECIMAL(18,2),
    discount_amount       DECIMAL(18,2),
    sales_amount          DECIMAL(18,2),
    cost_amount           DECIMAL(18,2)
);



#  Dimensions:
CREATE TABLE dim_customer (
    customer_key BIGINT,
    customer_id  STRING,
    customer_name STRING,
    province STRING,
    customer_segment STRING
);

CREATE TABLE dim_product (
    product_key BIGINT,
    product_id STRING,
    product_name STRING,
    category STRING,
    brand STRING
);

CREATE TABLE dim_date (
    date_key INT,
    calendar_date DATE,
    year INT,
    quarter INT,
    month INT,
    month_name STRING,
    day_of_week STRING
);

Grain:Fact Table

The grain defines exactly what one row in a fact table represents.
Grain 定义 Fact Table 中“一行数据到底代表什么业务事件”。

One row = one sales transaction
一行 = 一笔销售交易

One row = one sales transaction
一行 = 一笔销售交易

One row = one order line
一行 = 一个订单明细

Grain is the semantic contract of the fact table.

Three common fact grains in Kimball

In data warehousing, these three grains are formally known as:

  1. Transaction Fact grain (事务粒度)
  2. Periodic snapshot Fact grain (周期快照粒度)
  3. Accumulating snapshot Fact grain (累积快照粒度)
Fact TypeGrain核心问题
Transaction FactOne business event
一次业务事件
What happened?
发生了什么?
Periodic SnapshotOne entity/process at a periodic point
某个周期时点的状态
What was the state?
当时状态如何?
Accumulating SnapshotOne process lifecycle
一个业务流程生命周期
How did the process progress?
流程进行到哪里?

Transaction Fact Grain

One row represents one business transaction/event.

e.g. One row = one order line

DateCustomerProductStoreQtySales
Sep 13C001P001S00111200
Sep 13C001P002S0012500
Sep 13C001P003S001150

Periodic snapshot Fact grain

A row represents the state of a business process at a regular point in time.
一行代表某个业务对象/流程在一个固定周期时间点的状态。

e.g. Account Balance Snapshot
One row = Customer Account + Day

DateAccountBalance
Sep 11A00110,000
Sep 12A0019,500
Sep 13A00111,000

Accumulating snapshot Fact grain

A single row represents the entire lifecycle of a process or a specific entity that moves through multiple, predictable milestones.

e.g. Order Fulfillment

Order Created
↓
Payment Approved
↓
Warehouse Processing
↓
Shipped
↓
Delivered

We can represent the entire lifecycle of an order in one row.

OrderOrder DatePayment DateShip DateDelivery Date
10001Sep 10Sep 10Sep 11Sep 13

Grain Determines Whether a Fact Is Valid

A fact is only meaningful if it is measured at the same grain as the fact table.
一个 Fact 只有在与 Fact Table 的 Grain 相匹配时,才是有意义、可以正确分析的。

Suppose we define:

Grain: One row represents one Order Line.

That means every row in the fact table represents exactly:

One product on one order

OrderProductQuantitySales Amount
O1001iPhone1$1,200
O1001AirPods2$500
O1002MacBook1$2,000

A error fact example.

OrderProductSales AmountOrder Total
O1001iPhone1,2001,700
O1001AirPods5001,700

there is issue on the column “Order Total”
把 $1,700 放进一个 Order-Line Grain 的 Fact Table,并让它看起来像每一行的可加 Fact,是错误的设计。 我们的 Fact Grain 是 “One row represents one Order Line.” 一行一个order 的 “行” – order 上的一行。

Order Total O1001 这份order的 合计金额, 是 “Order Grain” – 一份order的. 放在目前的Fact 上就不对。

如果一定要使用 “Order Total ”, 那就再叫另外一个Fact_order,

Grain:One row per Order

OrderCustomerOrder TotalShipping Cost
O1001C001170020
O1002C002200030

Grain Determines Dimension Context

Kimball-style terminology: The grain defines not only what the fact represents, but also which dimensions can validly describe the row.

Dimensions

A Dimension is a business-oriented structure that provides the descriptive context used to analyze facts.
用于描述和分析 Fact 的业务分析结构。

A Very Important Kimball Principle

Kimball Principle: Dimensions should be understandable to business users.

Data Modeling

Data Modeling is the process of deciding how business data should be

  • structured,
  • organized,
  • related,
  • represented

so that people and computer systems can use it correctly.

In simple terms: Data Modeling = deciding what data we have, what each piece of data means, how different data is related, and how we should organize it.

Data Modeling include:

  • Conceptual Modeling
  • Logical Modeling
  • Physical Modeling
  • Operational Data Modeling
  • Relational Modeling
  • Data Vault
  • Dimensional Modeling
    e.g. Kimball dimensional modeling
  • Other Modeling Approaches

What is Data Modeling actually DOING?

We take the real business world and translate it into a structured data representation that a computer can store, query, analyze, and maintain.

Data Modeling is about MEANING, not just tables.

The basic building blocks of Data Modeling

English中文
Entity实体: 我们要管理的“东西”

可识别 + 业务相关 + 可以被描述
An Entity is a distinct business object or concept that we want to represent in data.

Identifiable + Relevant + Describable
Attribute属性: 描述这个东西的信息An Attribute describes a property or characteristic of an entity.
Relationship关系: 东西和东西之间怎么关联
Cardinality基数 / 数量关系

一个对多少个
Cardinality specifies how many instances of one Entity can be associated with an instance of another Entity.
1:1, 1:N, N:1, N:N
Key键Cardinality specifies how many instances of one Entity can be associated with an instance of another Entity.
simple, “Which exact record is this?”

A Primary Key is the chosen attribute or combination of attributes that uniquely identifies each row in a table.
A Foreign Key is an attribute in one entity/table that references the key of another entity/table.
Constraint约束

The three levels of Data Modeling

Conceptual Model

Conceptual Model is a high-level representation of the major business entities and their relationships.

Simply, what business things exist? 业务上有什么东西?

Logical Model

The Logical Data Model defines the detailed structure of the data, including entities, attributes, relationships, keys, and business rules, without depending on a specific database technology.

Simply, how should the business data be logically organized?

Physical Model

The Physical Data Model describes how the logical model will actually be implemented in a specific database, data warehouse, lakehouse, or other technology.

Simply, how will we actually store and implement the data?

ModelQuestion中文
ConceptualWhat?有什么业务东西?
LogicalHow is it organized?数据逻辑上怎么组织?
PhysicalHow is it implemented?技术上怎么真正实现?

What is Normalization?

Normalization is a data modeling technique used to organize data so that:

  • unnecessary duplication is reduced
  • data dependencies are correctly represented
  • update anomalies are minimized
  • data integrity is improved

Why do we normalize data?

Normalization organizes data around business entities and dependencies. It reduces unnecessary redundancy and prevents update, insert, and delete anomalies while improving data integrity and maintainability.
Normalization 是根据业务实体和数据依赖关系来组织数据,减少不必要的数据冗余,避免 Update、Insert 和 Delete Anomalies,同时提高数据完整性和可维护性。

First Normal Form — 1NF

A table is in 1NF when each attribute contains atomic values, meaning each cell represents a single value rather than a repeating group or list.
每个 Cell 应该保存一个 Atomic Value(原子值),而不是一个列表或重复组。

Second Normal Form — 2NF

A table is in 2NF when:

  1. It is already in 1NF 首先必须满足 1NF
  2. Every non-key attribute depends on the whole primary key, not only part of a composite key. 所有非 Key 属性必须依赖于整个 Primary Key, 不能只依赖 Composite Key 的一部分

Third Normal Form — 3NF

A table is in 3NF when:

  1. It is in 2NF
  2. Non-key attributes depend on the key, the whole key, and nothing but the key.

Grain

粒度

The grain defines exactly what one row in a fact table represents.
Grain 定义 Fact Table 中“一行数据到底代表什么业务事件”。

Key Takeaways

  1. Data Modeling translates the real business world into structured data.
    是把现实业务世界转换成结构化的数据。
  2. An Entity represents a business object or concept.
    表示一个业务对象或业务概念。
  3. An Attribute describes an Entity.
    描述 Entity 的特征
  4. A Relationship describes how Entities are connected.
    描述不同 Entity 之间如何关联。
  5. Cardinality describes how many instances of one Entity can relate to another.
    描述两个 Entity 之间“一对一、一对多、多对多”的数量关系。

Data mesh

Data mesh is a decentralized data architecture and organizational model that shifts data ownership from a single central IT team to individual business domains.

Its core idea is: Data should be owned and managed by the business domains that understand that data best, while still following common enterprise governance standards.

Instead of one central data team owning everything, different business domains become responsible for their own data products.

Enterprise
│
├── Customer Domain
│   └── Customer Data Product
│
├── Finance Domain
│   └── Finance Data Product
│
├── Risk Domain
│   └── Risk Data Product
│
├── HR Domain
│   └── Employee Data Product
│
└── Operations Domain
    └── Operations Data Product

Data Mesh, on the other hand, becomes: Domain owns the data, Enterprise governs the data.

Finance Domain → looks after Finance Data
HR Domain → looks after HR Data
Risk Domain → looks after Risk Data
Customer Domain → looks after Customer Data

What is Data Mesh trying to address?

  • Domain Ownership
    Data is owned by the business domains.
  • Data as a Product
    Data must be treated like a product.
  • Self-Serve Data Platform
    The enterprise provides a centralized platform enabling domains to autonomously publish and govern their data.
  • Federated Computational Governance
    The enterprise continues to define standardized rules.
    • Security
    • Privacy
    • Governance
    • Compliance
    • Data Quality
    • Metadata
    • Lineage

What is Domain-Driven Modeling?

Domain-Driven Modeling means: Designing data models around the business domains, business concepts, business processes, and business rules rather than starting from source-system tables.

Domain vs Canonical Model

Canonical Model ≠ Data Mesh

Data Mesh –>Reorganize data ownership, data products, the platform, and governance.

                 Enterprise
                     │
             Data Mesh Governance
                     │
        ┌────────────┼────────────┐
        ↓            ↓            ↓
    Customer       Finance       Risk
     Domain         Domain       Domain
        │            │            │
     Canonical    Canonical    Canonical
      Model         Model        Model
        │            │            │
    Data Product  Data Product  Data Product

Data Mesh targets a different set of challenges: data is owned by the business domains, it must be treated like a product, and the enterprise provides a unified self-serve platform. Ultimately, it requires reorganizing data ownership, data products, the platform, and governance.

What exactly are we modeling in Domain-Driven Design?

Business Domain

First, determine: What business area are we modeling?

  • Customer
  • Payment
  • Risk
  • Mortgage
  • Finance

Business Capability

Within a domain, we can further examine business capabilities

Customer Domain
│
├── Customer Onboarding
├── Customer Identification
├── Customer Profile Management
├── Customer Relationship Management
└── Customer Communication

Capability indicates: What the business domain can do.
Capability 表示:这个业务领域能够做什么。

Business Concept

Then, identify the truly critical business concepts within the domain.
然后识别 Domain 中真正重要的业务概念。

# Customer Domain:
Customer
Customer Profile
Customer Relationship
Customer Address
Customer Contact

# Payment Domain:
Payment
Payment Instruction
Payment Method
Payment Transaction
Payment Status

Business Event

Taking it a step further: What events occur within the domain?

e.g.

  • CustomerCreated
  • CustomerUpdated
  • CustomerAddressChanged
  • PaymentInitiated
  • PaymentCompleted
  • PaymentFailed

In Domain-Driven Design (DDD), things that “happen” are specifically called “Domain Events.”

Using the word “events” makes your phrasing sound highly sophisticated and immediately signals the right architectural concept to other engineers.

Business Rule

Domain has business rules. e.g.

Payment amount > $10,000
↓
Additional approval required

Data Entity

Finally, data modeling

Customer
Account
Payment
Address
Transaction

THen define

Attributes
Keys
Relationships
Cardinality
Constraints
History

Therefore, the overall process is as follows:

Business Domain
       ↓
Business Capability
       ↓
Business Concept
       ↓
Business Event
       ↓
Business Rule
       ↓
Domain Entity
       ↓
Data Model
       ↓
Data Product

Complete example

Step 1 — Identify Domain

Customer Domain: Manage customer identity, profile and relationship information.

Step 2 — Identify Business Concepts

Customer
Customer Profile
Customer Address
Customer Contact
Customer Relationship

Step 3 — Identify Business Events

CustomerCreated
CustomerUpdated
CustomerAddressChanged
CustomerStatusChanged

Step 4 — Identify Business Rules

e.g. Customer must have a unique enterprise customer ID.

Customer status must be one of:

  • ACTIVE
  • INACTIVE
  • SUSPENDED
  • CLOSED

Step 5 — Build Domain Model

Customer
│
├── Customer Profile
│
├── Customer Address
│
├── Customer Contact
│
└── Customer Relationship

Step 6 — Map Source Systems

CRM
   │
   ├── CRM_CUSTOMER
   └── CRM_CONTACT
             │
             ↓
Core Banking ─────→ Customer Domain
   │
   └── CUSTOMER
             │
             ↓
Mortgage
   │
   └── BORROWER

Step 7 — Canonical Model

Customer
------------------------
customer_id
customer_type
first_name
last_name
date_of_birth
status
created_date
updated_date

Step 8 — Data Product

Customer Domain provides “Customer Data Product”.

e.g. customer.gold_customer. it should has

  • Owner
  • Schema
  • Description
  • Data Quality
  • SLA
  • Security
  • Lineage
  • Documentation
  • Access Policy

As a result, the downstream Risk team does not need direct access to:

  • CRM
  • Core Banking
  • Mortgage

Instead, they consume: Customer Data Product

How to implement in Databricks

                    Enterprise Data Mesh
                            │
              Federated Governance
                            │
        ┌───────────────────┼───────────────────┐
        ↓                   ↓                   ↓
 Customer Domain       Finance Domain       Risk Domain
        │                   │                   │
        ↓                   ↓                   ↓
 Unity Catalog         Unity Catalog        Unity Catalog
        │                   │                   │
        ↓                   ↓                   ↓
 Delta Tables          Delta Tables         Delta Tables
        │                   │                   │
        ↓                   ↓                   ↓
 Data Products         Data Products        Data Products

Catalog / Schema designing

e.g.

customer_catalog
│
├── bronze
├── silver
└── gold

Do not think “One Domain = One Catalog”,
No, implementation choice, it is NOT data Mesh define

Domain-owned tables

-- ============================================================
-- PURPOSE:
-- Create the Customer domain's curated customer entity.
--
-- KEY IDEA:
-- The Customer domain owns the business meaning and quality
-- of this dataset.
-- ============================================================

CREATE TABLE customer_catalog.gold.customer
(
    -- Enterprise-wide business identifier.
    customer_id STRING NOT NULL,

    -- Business classification of the customer.
    customer_type STRING,

    -- Standardized customer name.
    first_name STRING,
    last_name STRING,

    -- Standardized date of birth.
    date_of_birth DATE,

    -- Controlled business status.
    status STRING,

    -- Audit columns.
    created_date TIMESTAMP,
    updated_date TIMESTAMP
)
USING DELTA;

Key Takeaways

Data Mesh is primarily about how an enterprise organizes ownership, products, platforms, and governance around data domains.

Domain: Business responsibility boundary

Domain-Driven Modeling: Business first –> Data model second

Canonical Model: Standardized enterprise representation of data

Data Product: A Data Product is not simply a Delta table.

Interview Questions and Answers

>> Talk yourself | Day-2-Day work | interested in position | Why work for us | Good Fit Role | Why hire you | Bring to team | Strength | Weakness | Jobs/task conflict | Change Requriement | Collaborate deploy AI/LLM | support-self-service | Translate-requirements-solution |

>> Design Metadata-Driven Pipeline | Design data Architecture | Incremental-Loading | Multiple-Domains Source | Troubleshoot | Performane Tuning | Quality-consistency | Monitor Pipeline | Migrating | Design models & schemas | Governance-security | CICD DevOps | Late-Arriving data |

>> Delta Live Tables DLT | Bundles & Job | Delta Sharing | Databricks Architecture | DBT | Schema Drift | hive to unity Catalog | Schema Enforcement | Schema Evolution | Time Travel | Schema Contract | Volumnes | Photon | Z-order | Liquid Clustering | catching | Boardcast | RDD-DF-DS|

Tell me about yourself.

I’m a Senior Azure Data Engineer with over 20 years of experience. I’ve worked across several domains, including financial services, consulting, the public sector, and healthcare.

I hold Microsoft and Databricks certifications. My core technical skills include Azure Data Factory, Databricks, Synapse, Fabric, Spark, Python, PySpark, SQL, and Power BI.

I’m a hands-on engineer. I focus on building production-ready, end-to-end data solutions. I also build metadata-driven, automated, reusable, and scalable data pipelines.

My work covers the entire data lifecycle, from ingestion and validation to transformation, standardization, enrichment, reconciliation, and reporting.

In addition, I have strong experience modernizing legacy data platforms and migrating existing data pipelines to modern platforms.

I also focus on data quality, security, and governance, including Unity Catalog. I work closely with business stakeholders, QA teams, business analysts, and data scientists.

I believe my experience in data engineering, automation, modernization, and governance aligns well with this role at ABC.

30 seconds’ answer

Can you talk about your day-to-day work? What’s your day-to-day work looks like?

My work covers several areas.

First, I review my tasks and priorities for the day. I also attend team meetings to discuss project progress and any blockers.

A big part of my work is hands-on data engineering. I use Databricks, Azure Data Factory, Python, PySpark, and SQL to ingest and transform data. I also validate the data and reconcile source and target results.

Another important part of my work is data quality. I check schemas, missing values, and duplicate records.

I also handle troubleshooting. If a pipeline fails or runs slowly, I check the logs, identify the root cause, fix the issue, and safely rerun the pipeline when needed.

I review code, test changes, and support deployments across different environments. I also work with business analysts, QA engineers, Data Scientists, and stakeholders to clarify requirements and resolve issues.

Finally, I update documentation and monitor production pipelines to make sure they run reliably.

Overall, my goal is to deliver reliable, high-quality data pipelines that meet business requirements.

Why are you interested in this position?

I’m interested in this role for three main reasons.

First, the role matches my experience with Azure Data Factory, Databricks, Synapse, and Power BI. I enjoy building reliable and scalable data pipelines that support business needs.

Second, I’m interested in the opportunity to work with company. I believe data plays an important role in improving business operations and supporting better decisions.

Finally, I believe I can bring my hands-on experience in data engineering, data quality, and data platform development to the team. I’d also like to contribute to company’s data initiatives.

That’s why I want to join your team.

20“ answer

Why do you think you are a good fit for this role?

I believe I’m a good fit for this role for three main reasons.

First, I have strong hands-on experience with Azure, Databricks, Data Factory, Synapse, and Power BI. I’ve used these technologies to build data solutions that support business needs.

Second, I have experience building reliable, scalable, and reusable data solutions. My work covers the full data lifecycle, including data ingestion and transformation to reporting and data quality. I also focus on performance tuning and making pipelines easy to maintain.

Finally, I have experience working with different teams to understand business needs and deliver production-ready data solutions.

I believe I have the skills and experience needed for this role.

20” answer

Why should we hire you?

I believe you should hire me because of my hands-on experience with Azure Data Factory, Azure Databricks, Synapse, and Power BI.

I have experience building end-to-end data solutions. My work covers the full data lifecycle, from ingestion and transformation to standardization, validation, and reporting.

I build reliable, scalable, and reusable data pipelines. I also focus on performance tuning, idempotency, and making pipelines easy to maintain.

Finally, I have real-world project experience. I work well with different teams and focus on delivering solutions that meet business needs.

I believe I can use my experience and skills to make a positive contribution to the team.

20” answer

What would you bring to our team?

> What would make you a valuable addition to our team?

I believe I can bring several strengths to the team.

First, I have hands-on experience with Azure Data Factory, Databricks, Synapse, and Power BI. I can build end-to-end data pipelines.

Second, I focus on building reliable, reusable, and secure data solutions that are easy to maintain.

Finally, I have solid project experience. I work well with other teams to understand their needs and deliver solutions efficiently.

I believe I can use these skills and experience to add value to the team.

20“ answer

What is your biggest strength as a Senior Data Engineer?

My biggest strength is that I can build end-to-end data solutions and make sure they are reliable, scalable, and easy to maintain. I focus not only on getting the job done, but also on data quality and long-term performance.

What is your biggest weakness?

> What is one area you need to improve?
> What would you like to improve about yourself?

One area I’m still improving is learning new technologies and business areas.

I have strong experience in data engineering, but every project is different. Sometimes, I need to learn new tools or understand a new business area.

When this happens, I read the documentation, do hands-on practice, and discuss with team members when needed.

I’m always willing to learn, and I can usually apply what I learn to my work quickly.

How do you prioritize competing requests, communicate with cross-functional teams, and ensure successful delivery?

Yes, I’ve done this in my previous projects.

First, I clarify the business requirements and expected outcomes. Then I assess each request based on business value, urgency, risk, dependencies, and estimated effort.

I work with business teams to understand their needs and priorities. If there are too many requests, I discuss with them what we should do first and what can wait.

I also collaborate with different teams, including business analysts, QA engineers, Data Scientists, and other data engineers. We use Scrum to organize the work into sprints, track milestones, and provide regular progress updates.

During development, I monitor risks and dependencies. If I identify a blocker, I raise it early and work with the team to resolve it.

Before delivery, I validate the results against the requirements and acceptance criteria. I also document important decisions and any issues that need follow-up.

My goal is to deliver the highest-priority business outcomes on time, while maintaining data quality and keeping stakeholders informed.

How do you collaborate with Data Scientists to prepare data and deploy machine learning models into production?

Yes, I’ve worked with Data Scientists to deploy AI/LLM, Machine learning models in my previous projects.

First, I understand the business requirements and expected outcomes. Then I work with the Data Scientists to understand their data needs, including schemas, data types, required features, and refresh frequency.

I prepare curated data using Databricks, PySpark, and SQL. I validate the data to make sure it is accurate, consistent, and complete.

I also build metadata-driven frameworks to automate data preparation and refresh. This makes the process reusable and easier to maintain.

For AI and RAG solutions, I prepare enterprise documents and extract metadata. I also support chunking, embedding, and indexing in a vector store.

For security, I follow the principle of least privilege. Users and applications only have access to the data they need.

Finally, I implement logging and monitoring. I work with the Data Scientists to resolve data issues and support production use.

My goal is to provide reliable, secure, and reusable data pipelines for analytics, machine learning, and AI applications.


How do you design and build an end-to-end data pipeline?

I usually start by understanding the business requirements and expected outputs. Then I profile the source data, checking schemas, data types, code values, missing data, and duplicates.

I use Azure Data Factory to orchestrate the pipeline. For incremental loading, I use CDC when available, or a watermark-based approach. For file-based ingestion, I can use Databricks Auto Loader.

I maintain metadata and control tables to store pipeline configurations, processing status, timestamps, and checkpoints.

To make pipelines reusable and scalable, I use metadata-driven frameworks and parameterized configurations. I also use Delta MERGE with appropriate business keys to support idempotent processing and prevent duplicate records.

For security and governance, I use Microsoft Entra ID, role-based access control, and Unity Catalog to manage access and data lineage.

My goal is to deliver reusable, scalable, reliable, and idempotent data pipelines that are ready for production and downstream consumption.

How do you design a metadata–driven framework to automate repetitive data integration tasks?

Yes, I’ve designed metadata-driven frameworks before.

I start by understanding the business requirements. Then I profile the source data and identify the schema, data types, and loading method.

I use metadata tables to store source and target information. I also store schemas, file locations, load types, and other configuration values.

At runtime, the pipeline reads the metadata. It then passes the configuration values to the right activities.

For incremental loading, I use CDC when the source supports it. For file-based data, I can use Databricks Auto Loader. I can also use watermarks to track incremental progress.

I maintain control tables to track run IDs, timestamps, processing status, checkpoints, and row counts.

For data quality, I check schemas, data types, missing values, and duplicates. I also compare source and target record counts and business control totals.

I never simply drop invalid records. I move them to a quarantine area and notify the responsible team. After the issues are fixed, I reprocess the records.

For security, I use Microsoft Entra ID, RBAC, Key Vault, and Unity Catalog.

The main benefit is reusability. For supported source patterns, I can onboard new sources by updating the metadata. I don’t need to build a separate pipeline for every source.

How do you design a data architecture that is scalable, reusable, and easy to maintain?

I usually start by understanding the business requirements, business processes, and expected outcomes.

Then I profile the source data. I check the schema, data types, volume, and data quality. I also identify the relationships between the data and the business needs.

Next, I design the data models. I define the conceptual and logical models first. If data comes from multiple domains, I may use a canonical model to standardize business terms and codes. For analytical data, I define the grain and design the fact and dimension tables.

For implementation, I follow the Medallion architecture: Bronze, Silver, and Gold. I use Azure Data Factory for ingestion and Databricks for data validation, cleaning, and transformation.

To make the solution reusable, I build metadata-driven pipelines. Configuration tables define the source, target, load type, and processing rules. Control tables track the run status, timestamps, and checkpoints. This allows me to onboard new data sources through configuration instead of building a separate pipeline for each source.

I also implement incremental loading, data quality checks, source-to-target reconciliation, and quarantine handling.

For security, I use Microsoft Entra ID, role-based access control, and Unity Catalog.

My goal is to build data solutions that are reusable, scalable, secure, and easy to maintain.

How do you design data models and schemas for analytics and downstream data consumers?

Yes, I’ve designed data models schemas for downstream consumption.

I start with the business requirements. I understand the business process, business events, and expected outcomes.

Then I define the grain. I make sure each fact table has a clearly defined and consistent grain.

Next, I design the fact tables, dimension tables, business keys, schemas, and relationships.

I also design conceptual, logical, and physical data models.

When data comes from different domains, business terms, definitions, and code values may differ. I use a canonical data model to standardize the data across these domains.

I also define clear schemas, column names, and data types. This makes the data easier to understand and use.

Finally, I prepare consistent, well-structured tables for downstream consumption. These tables support reports, visualizations, and Power BI semantic models.

How would you integrate operational source data from multiple systems to support planning and day-of operations?

Yes, I have handled the similar projects multiple source domains before.

I would start by understanding the business requirements and the business’ operational needs. For example, the airport may need to combine flight, baggage, and ground operations data to support planning and daily operations.

First, I would identify the source systems, data owners, data formats, refresh frequency, and data quality issues. I would also clarify whether the business needs batch processing or near-real-time data.

Then, I would use Azure Data Factory to ingest the data and Databricks to process it through the Bronze, Silver, and Gold layers.

Since the data comes from different systems, I would standardize the schemas, business keys, timestamps, and code values. I would use a canonical data model where needed to make the data consistent.

I would also implement data quality checks and source-to-target reconciliation. If records were invalid, I would quarantine them for review instead of simply dropping them.

For incremental loading, I would use CDC when available. For file-based data, I could use Auto Loader. Otherwise, I would use watermarks and control tables.

I would apply access controls and data governance, and monitor the pipelines to ensure they run reliably.

Finally, I would work with airport operations teams to validate the results against their business requirements.

My goal would be to provide reliable, consistent, and timely data that helps airport teams make better operational decisions.

How do you Migrating existing ETL processes into production and make them reliable and maintainable?

Yes, I’ve migrated existing ETL processes to modern data platforms before.

First, I understand the business requirements and review the existing ETL process. I check the business logic, dependencies, source data, data quality, and expected outcomes.

Then I assess the target environment and identify the risks. I prepare a backup and recovery plan before making any changes.

Next, I define the source-to-target mapping and design the new solution. I choose the migration approach based on the business requirements, technical needs, and risk level.

Before deployment, I test the new solution. I validate the business logic, data quality, and transformation results. I also reconcile the source and target data.

During migration, I keep the existing solution running when possible. This helps reduce business disruption and provides a fallback option.

After deployment, I compare the old and new solutions. I check record counts, key business totals, and transformation results. I also work with stakeholders to confirm that the new solution meets the requirements.

For production support, I configure logging, monitoring, alerts, and error handling. I also prepare an operational runbook that covers dependencies, recovery steps, and rollback procedures. I use version control and CI/CD to make future changes safer and easier to maintain.

My goal is to deliver a reliable, recoverable, and maintainable solution with minimal business disruption.

How do you collaborate with Data Scientists to prepare data and deploy machine learning models into production?

Yes, I’ve worked with Data Scientists to deploy AI/LLM , Machine Learning in my previous projects.

First, I understand the business requirements and expected outcomes. Then I work with the Data Scientists to understand their data needs, including schemas, data types, required features, and refresh frequency.

I prepare curated data using Databricks, PySpark, and SQL. I validate the data to make sure it is accurate, consistent, and complete.

I also build metadata-driven frameworks to automate data preparation and refresh. This makes the process reusable and easier to maintain.

For AI and RAG solutions, I prepare enterprise documents and extract metadata. I also support chunking, embedding, and indexing in a vector store.

For security, I follow the principle of least privilege. Users and applications only have access to the data they need.

Finally, I implement logging and monitoring. I work with the Data Scientists to resolve data issues and support production use.

My goal is to provide reliable, secure, and reusable data pipelines for analytics, machine learning, and AI applications.

How do you manage data governance, security, access control, and compliance in a data platform?

Yes, I’ve managed data governance, security and compliance in my previous projects.

First, I understand the business requirements and the company’s security policies.

I use Microsoft Entra ID to manage identities. I use role-based access control to manage permissions for users, groups, and applications.

I follow the principle of least privilege. I only give them the access they need.

In Databricks, I use Unity Catalog to manage data access and governance. I also use data lineage to track where the data comes from.

For secrets, I use Azure Key Vault to store passwords, API keys, and connection strings. Pipelines can retrieve these secrets securely at runtime.

My goal is to protect data, control access, and meet the company’s security and compliance requirements.

How do you troubleshoot a data pipeline that fails or runs much slower than expected in production?

Yes, I’ve handled performance tuning and troubleshooting in production.

For performance tuning, I first establish a baseline. I don’t make changes before identifying the bottleneck.

I check the business requirements and profile the source data. Then I review the logs and use Spark UI to identify slow tasks, shuffle operations, and data skew.

I also review the SQL queries. I filter data early and select only the required columns. If one side of a join is small enough, I consider using a broadcast join.

For data skew, I check the root cause. Depending on the situation, I may use AQE or salting. If there are too many small files, I consider Delta Lake OPTIMIZE. If a dataset is reused several times, I consider caching it.

Finally, I compare the results with the baseline to confirm the improvement.

For pipeline failures, I first check the logs and alerts. I identify the failed activity and assess the impact on downstream systems.

Then I review recent changes, source data, ingestion, transformation, validation, and reconciliation. I also check the business logic to find the root cause.

If it is a data issue, I work with the responsible team to correct it. If it is a technical issue, I fix the code or configuration.

After fixing the issue, I rerun the process safely. I validate the results and reconcile the data before confirming recovery.

My goal is to restore the pipeline quickly and keep it reliable, accurate, and scalable.

How do you implement CI/CD, DevOps, and DataOps practices for data engineering?

Yes, I’ve done this CI/CD, DevOps in my project.

I use GitHub for version control and Azure DevOps to automate the CI/CD process.

Each team member works on a separate branch. After completing the code, they create a pull request. Another team member reviews the changes. Once approved, the code is merged into the main branch.

I also use Scrum to organize the work into sprints and track progress against milestones.

For deployment, I maintain separate development, SIT, UAT, and production environments. I use Azure DevOps pipelines to automate testing and promote approved changes between environments.

I also include data quality checks and reconciliation to make sure the pipeline produces the expected results. Before production deployment, I work with stakeholders to complete validation and obtain sign-off.

In addition, I document the changes and maintain operational runbooks. I also make sure deployment issues can be investigated and resolved safely.

My goal is to make releases reliable, traceable, repeatable, and easy to maintain.

What is Databricks’ architecture?

Databricks uses a lakehouse architecture. It combines a data lake and a data warehouse.

There are three main parts.

First, the control plane manages the workspace, notebooks, and jobs.

Second, the compute plane runs Spark jobs and SQL queries. It processes the data.

Third, the storage layer stores data in cloud storage, such as Azure Data Lake Storage. Delta Lake helps keep the data accurate and reliable.

We often use the medallion architecture to organize data.

The Bronze layer stores raw data. The Silver layer cleans and transforms the data. The Gold layer stores data for business reports and analytics.

We also use Unity Catalog to manage data access and permissions.

Together, these components help us build secure and scalable data solutions.

How do you optimize data pipelines when working with large and heterogeneous datasets?

Yes, I’ve optimized data pipelines before.

First, I establish a baseline. This helps me measure the improvement.

Then I profile the data. I check the data volume, schema, data types, and data quality.

I review the SQL queries. I select only the necessary columns and filter data before joins.

If one side of a join is small enough, I use a broadcast join. If I reuse a dataset several times, I consider caching it.

I also use Spark UI to identify bottlenecks. I check slow tasks, shuffle operations, and data skew.

If there are too many small files, I use Delta Lake OPTIMIZE when needed. I also review the partition strategy and enable AQE when appropriate.

For large datasets, I use incremental loading. I use CDC when available. Otherwise, I may use a watermark or file-based processing.

I maintain control tables to track job IDs, processing status, timestamps, and checkpoints.

Finally, I compare the results with the baseline. My goal is to reduce runtime and cost while keeping the pipeline reliable and scalable.

How do you ensure data quality and data consistency across multiple source systems?

Yes, I’ve handled data quality and consistency across multiple source systems.

First, I understand the business requirements and profile the source data. I check the schema, data types, missing values, and duplicates.

When data comes from different systems, business definitions and code values may differ. I use a canonical data model to standardize the data.

Then I use Databricks to validate the data. I check schemas, data types, business rules, and code values. I also remove duplicate records based on business keys and timestamps.

Next, I reconcile the source and target data. I compare record counts, business keys, and business control totals.

I never simply drop invalid records. I move them to a quarantine area and notify the responsible team. After the issues are fixed, I reprocess the records.

I also use Delta MERGE to insert new records and update existing records. Control tables help me track processing status and results.

My goal is to deliver consistent, accurate, and reliable data for production and downstream analytics.

How do you monitor data pipelines and ensure they run reliably in production?

Yes, I’ve done monitor data pipelines in my prijects before.

In one of my previous projects, I worked on a metadata-driven data platform. We incrementally loaded data from around 12 to 18 source tables every day.

First, I used Azure Data Factory monitoring and Databricks job monitoring to track pipeline execution. I also maintained logging and control tables. These tables recorded the run ID, source information, start and end times, processing status, and checkpoints.

I configured alerts to notify the responsible team when a pipeline failed or encountered an issue.

I also implemented data quality checks in Databricks. These checks covered schemas, data types, code values, missing values, and duplicate records.

For reconciliation, I compared source and target record counts and key business control totals. If records were invalid or failed validation, I routed them to a quarantine area instead of simply dropping them. The responsible team could review and fix the issues before we safely reran the pipeline.

After recovery, I validated the results and confirmed that the data was consistent.

My goal is to detect problems early, recover safely, and keep production pipelines reliable and stable.

How do you handle changing business requirements during a data engineering project?

Yes, I’ve handled changing requirements in a previous project involving nearly 50 tables.

We were already in the middle of development when the business requirements changed.

First, I reviewed the new requirements and compared them with the existing ones. I worked with business stakeholders to clarify the changes, including the business rules and data refresh frequency.

Then I assessed the impact on the data model, pipeline design, development effort, testing, and delivery timeline.

For major changes, I built a proof of concept to validate the proposed solution. I also discussed the risks, effort, and timeline with the team and stakeholders before we agreed on the approach.

Once the changes were approved, I updated the design and implemented the required changes. I also updated the test cases and validated the schema, data types, business rules, and source-to-target reconciliation.

Finally, I documented the changes and obtained stakeholder confirmation that the solution met the updated requirements.

My goal is to manage changes in a controlled way while maintaining data quality and delivering a reliable solution that meets business needs.

How do you implement incremental data loading and handle CDC, updates, and duplicate records?

Yes, I’ve implemented incremental data loading before.

First, I check the source system and its capabilities.

If CDC is available, I use it to capture inserts, updates, and deletes.

For file-based data, I use Databricks Auto Loader to process new files.

If CDC is not available, I can use a watermark. I maintain a control table to track run IDs, timestamps, processing status, and checkpoints.

To handle duplicates, I use ROW_NUMBER with a business key and update timestamp. This helps me keep the latest record for each key.

Then I use Delta MERGE to insert new records and update existing records. I deduplicate the source data before the merge and use stable business keys.

If the source does not provide delete events, I check for a soft-delete flag or audit table. If the source provides a full snapshot, I can compare source and target keys to identify possible deletions.

Finally, I design the pipeline to be idempotent. If a job fails and runs again, it should not create duplicate records.

This makes the pipeline reliable and easier to recover.

How do you design reusable data pipelines and support self-service analytics through semantic models and Power BI?

Yes, I’ve done this before. I worked on a Greenfield data platform project involving nearly 500 tables.

First, I built reusable, metadata-driven pipelines using Azure Data Factory and Databricks. I used metadata and control tables to manage source information, load types, processing status, and checkpoints.

For incremental loading, I used CDC when available. Otherwise, I used watermarks or other suitable loading methods.

I also implemented data quality checks, including schema validation, business rules, and source-to-target reconciliation. If records were invalid, I isolated them for review instead of simply dropping them.

To support self-service analytics, I prepared curated Gold-layer data and designed fact tables, dimension tables, and clear relationships. I also supported Power BI semantic models with consistent business definitions and reusable measures.

This allowed business analysts to create their own reports, filter data, and analyze different business dimensions without depending on data engineers for every reporting request.

Because the data came from different business domains, I also used a canonical data model to standardize definitions and improve consistency.

My goal was to provide reusable pipelines and trusted data, so business users could perform self-service analytics more efficiently.

How do you work with business stakeholders and data analysts to translate business requirements into data solutions?

Yes, I’ve done this – translate business requirements into data solutions, before.

In one of my previous projects, I worked on incremental data loading from databases. The solution processed around 32 to 50 megabytes of data per day and involved between 12 and 80 tables.

First, I understood the business process and expected outcomes. I worked with key stakeholders and data analysts to clarify business definitions, required outputs, acceptance criteria, and refresh SLAs.

Then I profiled the source data. I checked schemas, data types, missing values, duplicates, and code values. I also created source-to-target mappings, Data dictionary, Business glossary and designed conceptual, logical, and physical data models.

Because the data came from multiple domains, some business definitions and code values were different. I designed a canonical data model to standardize them and make the data consistent.

Based on the agreed requirements, I built the data pipelines using Azure Data Factory and Databricks. I implemented data validation, transformation, deduplication, and source-to-target reconciliation.

I compared record counts, business keys, and key business control totals. I then worked with stakeholders and data analysts to validate the results against the acceptance criteria.

After business sign-off, I moved the solution into production and prepared the documentation and operational runbook.

My goal was to translate business requirements into a reliable, scalable, and maintainable data solution.

Landing Zone

A Microsoft Landing Zone usually refers to an Azure Landing Zone (often part of the Cloud Adoption Framework (CAF)). It is a pre-built, best-practice cloud foundation that organizations use to deploy workloads in Azure in a secure, governed, and scalable way.

A Landing Zone is the “foundation environment” in the cloud:

  • networking is ready
  • security is enforced
  • identity is centralized
  • governance is in place
  • logging & monitoring are enabled

Core Components

  • Identity & Access (Entra ID)
    • Central authentication
    • RBAC roles
  • Networking
    • Hub-Spoke architecture
    • VNet design
    • Private endpoints
  • Governance
    • Policies (Azure Policy)
    • Management Groups
    • Resource tagging standards
  • Security
    • Microsoft Defender for Cloud
    • Security baselines
    • Key Vault for secrets
  • Monitoring
    • Log Analytics
    • Azure Monitor
    • Alerting system
Star schema vs Snowflake schema

Star schema has a central fact table connected directly to denormalized dimension tables. It is simple and fast for querying.
Snowflake schema has normalized dimension tables, where dimensions are split into multiple related tables.

Snowflake = more normalized, less redundancy but more joins

Star = simpler, faster queries

How do you design a dimensional model?

I design it using business requirements:

  • Align with BI/reporting needs
  • Identify facts (measures) like sales, transactions
  • Identify dimensions like customer, product, time
  • Choose grain (very important)
  • Use surrogate keys for dimensions
  • Apply star schema for analytics performance

What is Azure Data Factory?

Azure Data Factory is a cloud-based data integration service used to create data-driven workflows for orchestrating and automating data movement and transformation across different data stores and compute services.

Key capabilities

  • Data ingestion
  • Data orchestration
  • Data transformation
  • Scheduling and monitoring
What are the core components of ADF?

The main components are:

ComponentPurpose
PipelineLogical grouping of activities
ActivitySingle task in a pipeline
DatasetData structure pointing to data
Linked ServiceConnection to external resources
TriggerSchedule or event that starts a pipeline
Integration RuntimeCompute infrastructure used to run activities
What is a Pipeline?

A pipeline is a logical grouping of activities that together perform a task such as data ingestion or transformation.

What is Integration Runtime (IR)?

Integration Runtime is the compute infrastructure used by ADF to perform data integration tasks.

  • Azure IR Fully managed compute in Azure
  • Self-hosted IR Runs on on-premises machines
  • Azure SSIS IR Used to run SSIS packages

Types:

What is a Linked Service?

A linked service defines the connection information needed for ADF to connect to external resources, example:

  • Azure SQL Database
  • Data Lake
  • databricks
  • On-Prem database
What is a Dataset?

A dataset represents the structure of data within a data store.

Difference between Pipeline and Data Flow
FeaturePipelineData Flow
PurposeOrchestrationData transformation
ComputeOrchestration engineSpark cluster
UIActivity workflowVisual transformation
How do you handle incremental loading?

Solution 1: Watermark column
last_modified_date:
Max(Last_modified)
WHERE last_modified > last_run_time

Solution 2: CDC
transaction log
change tracking

Solution 3: File-based incremental
folder partition by date

How do you implement error handling?

Try-Catch pattern
Failure path
Retry policy

Activity
├ success → next step
└ failure → error handling pipeline

What are triggers in ADF?

Triggers are used to automatically start pipelines.

TriggerPurpose
Schedule triggerTime-based execution
Tumbling windowTime-based incremental
Event triggerStorage events
What is Tumbling Window Trigger?

A tumbling window trigger runs pipelines at fixed time intervals and processes data in discrete time windows.

How do you parameterize pipelines?

ADF supports parameters at:

  • Linked Service
  • plpeline
  • dataset
What are common ADF performance optimizations?

Parallel copy: pipeline success; pipeline duration; failure rate
Staging: use blob staging
Partitioning: split large tables

How do you monitor pipelines?

Monitoring options:
ADF Monitor UI
Azure Monitor
Log Analytics

Difference between Mapping Data Flow vs Pipeline

Azure Data Factory Pipeline is an orchestration layer used to coordinate activities (copy, Databricks, API calls).
Mapping Data Flow is a visual ETL engine running on Spark for transformations without coding

How do you handle retries and failure recovery?

I handle failures using:

  • Delta Lake ACID for safe writes and rollback support
  • ADF retry policies (activity-level retries)
  • Idempotent pipeline design (safe re-runs)
  • Checkpointing in streaming jobs
  • Logging + monitoring (Log Analytics / Databricks logs)
How do you orchestrate Databricks notebooks from ADF?

I use ADF Databricks Notebook activity:

  • Prefer job clusters for cost optimization
  • Pass parameters from ADF to notebook
  • Use cluster or job cluster
  • Chain multiple notebooks in pipeline
  • Use retries + monitoring in ADF
ADF retry policies (activity-level retries)

ADF supports built-in retry at the activity level:

  • You can configure retry count + interval
  • Used for transient failures (network, timeout, throttling)
  • Works per activity (Copy, Databricks, Web, etc.)
  • Combined with timeout settings for better resilience

But retries should not replace good design (idempotency is still required).

ADF → Databricks Notebook failure: how do you know what happened?

From ADF side, I rely on:

  • Activity output logs
    • ADF captures Databricks job run URL + run ID
  • Error message propagation
    • ADF shows Databricks notebook failure message (exit code / exception summary)
  • Databricks Job Run API / UI
    • Use run ID to open detailed error logs in Databricks
  • Log Analytics integration
    • Centralized monitoring if enabled
  • Notebook logging best practice
    • Explicit try/except + logging errors back to ADF (custom messages)

So ADF gives high-level error, Databricks gives detailed stack trace.

How do you manage “Schema Drift” when ingesting data from diverse, changing corporate sources using Azure Data Factory (ADF)?

Answer: * I design a resilient ingest architecture rather than forcing hardcoded mappings. In ADF, I use Mapping Data Flows with the “Allow Schema Drift” option enabled so the pipeline doesn’t break when a source team adds a column.

When landing data into the Databricks Bronze layer, I utilize Databricks Auto Loader (cloudFiles) with Schema Evolution enabled (.option("mergeSchema", "true")). This allows Delta Lake to automatically infer and append new columns to the table schema on-the-fly, while isolating structural alerts into a monitoring log.


Describe the data storage options available in Databricks.

Databricks offers several ways to store data. First, there’s the Databricks File System for storing and managing files. Then, there’s Delta Lake, an open-source storage layer that adds ACID transactions to Apache Spark, making it more reliable. Databricks also integrates with cloud storage services like AWS S3, Azure Blob Storage, and Google Cloud Storage. Plus, you can connect to a range of external databases, both relational and NoSQL, using JDBC.

What is Databricks Delta (Delta Lakehouse) and how does it enhance the capabilities of Azure Databricks?

Databricks Delta, now known as Delta Lake, is an open-source storage layer that brings ACID transactions to Apache Spark and big data workloads. It enhances Azure Databricks by providing features like:

  • ACID transactions for data reliability and consistency.
  • Scalable metadata handling for large tables.
  • Time travel for data versioning and historical data analysis.
  • Schema enforcement and evolution.
  • Improved performance with data skipping and Z-ordering
Are there any alternative solution that is similar to Delta lakehouse?

there are several alternative technologies that provide Delta Lake–style Lakehouse capabilities (ACID + schema enforcement + time travel + scalable storage + SQL engine). such as,

  • Apache Iceberg
  • Apache Hudi
  • Snowflake (Iceberg Tables / Unistore)
  • BigQuery + BigLake
  • AWS Redshift + Lake Formation + Apache Iceberg
  • Microsoft Fabric (OneLake + Delta/DQ/DLTS)
What is Delta Live Table? Have you used DLT?

Yes. Delta Live Tables, or DLT, is a Databricks framework for building and managing reliable data pipelines. In current Databricks terminology, it is part of Lakeflow Declarative Pipelines, but DLT is still commonly used in projects and interviews.

I have used DLT in my previous projects, mainly for production data pipelines using the Bronze, Silver, and Gold architecture.

For example, in the Bronze layer, we ingested raw data from sources such as APIs, files, and enterprise systems. In Silver, we used DLT for data cleansing, validation, deduplication, CDC processing, and business transformations. The Gold layer provided curated datasets for reporting and downstream applications.

One of the key features I used was data quality expectations. I could define rules such as required business keys, valid values, and data completeness. Depending on the requirement, invalid records could be quarantined or handled separately instead of simply being dropped, while the pipeline continued processing valid data.

DLT is also declarative, which means I define what the target datasets should look like and how they depend on upstream data, rather than manually managing every execution step. Databricks manages things such as pipeline dependencies, incremental processing, monitoring, and lineage.

I also used DLT with incremental processing and CDC patterns, including identifying new or changed records using business keys and timestamps and applying changes to Delta tables.

So, in my experience, DLT is not just a transformation tool. I used it as part of a production-grade data engineering solution, covering ingestion, transformation, data quality, incremental processing, CDC, dependency management, monitoring, and the overall Bronze-Silver-Gold architecture.

Why DLT instead of regular Databricks jobs?

I would use DLT when I need a more managed and reliable data pipeline, especially for multi-stage production pipelines.

The main advantage is that DLT provides a declarative approach. I define the data transformations and dependencies, and Databricks manages much of the pipeline execution.

It also provides built-in capabilities for data quality expectations, dependency management, incremental processing, lineage, monitoring, and pipeline recovery.

For example, if I have a Bronze-to-Silver-to-Gold pipeline with multiple dependent datasets, DLT can manage those dependencies and process the data incrementally instead of requiring me to build all of that orchestration logic myself.

Regular Databricks Jobs are still very useful, especially for custom Python or PySpark processing, batch jobs, orchestration, and tasks that don’t naturally fit a declarative pipeline.

So I would say the key difference is: Databricks Jobs are primarily an execution and orchestration mechanism, while DLT provides a more complete framework for building and operating reliable data pipelines.

Delat Live table vs Telta Table side by side

Delta Table vs Delta Live Tables (Side-by-Side)

FeatureDelta TableDelta Live Tables (DLT)
DefinitionStorage layer built on Delta Lake formatManaged ETL framework built on top of Delta Lake
Main PurposeStore reliable data with ACID propertiesBuild and manage data pipelines automatically
TypeData storage / table formatData pipeline orchestration framework
ResponsibilityUser manages ETL logic manuallySystem manages ETL pipeline automatically
Pipeline ManagementNot includedBuilt-in (dependency handling, orchestration)
Data ProcessingManual (SQL / PySpark / Spark jobs)Declarative (define tables, system executes pipeline)
ETL ControlFully controlled by developerPartially automated (framework-managed execution)
Data Quality RulesNot built-inBuilt-in (expect, expect_or_drop, etc.)
MonitoringExternal tools requiredBuilt-in monitoring & observability
Lineage TrackingManual or external toolsAutomatic lineage tracking
Streaming SupportManual setup requiredNative streaming support built-in
Incremental ProcessingManually implementedAutomatically handled
Error Handling / RetryDeveloper must implementBuilt-in retry & recovery
CI/CD IntegrationPossible but manualFully integrated with pipelines
Underlying StorageParquet-based Delta formatUses Delta Tables underneath
Use CaseStore data, build tables, SQL analyticsBuild production ETL pipelines (Bronze/Silver/Gold)
Complexity LevelLower concept complexityHigher abstraction, easier operations
What is schema evolution in Delta Lake?

Schema evolution allows Delta tables to automatically or manually adapt when new columns are added or schema changes occur, without breaking pipelines.

What is Schema Enforcement?

Schema Enforcement means the system validates incoming data against a predefined schema before writing the data. It checks column names, data types, and structure to ensure data consistency and quality. And the system will reject the write or throw an error if incoming data does not match the expected schema.

What is Schema Contract?

A schema contract is an agreement between a data producer and a data consumer that defines the expected structure and rules of the data.

For example, it can define the required columns, data types, nullable rules, and sometimes business constraints.

The purpose is to make sure the producer and consumer have a clear and stable understanding of what the data should look like.

For example, if the contract says customer_id must be a non-null STRING, the producer should always provide the data in that format. If the producer wants to make a breaking change, such as changing the data type, that change needs to be agreed upon and managed.

So, in simple terms, a schema contract is the agreed data interface between the producer and the consumer.

What is Time Travel?

Time Travel is a feature that allows you to access and query previous versions of data in a table.

In Delta Lake, every data change (insert, update, delete) is versioned. This means the system keeps a history of changes, and you can query the table as it existed at a specific point in time or version.

SELECT * FROM table VERSION AS OF 5;
SELECT * FROM table TIMESTAMP AS OF '2024-01-01';
Explain how you can use Databricks to implement a Medallion Architecture (Bronze, Silver, Gold).
  1. Bronze Layer (Raw Data): Ingest raw data from various sources into the Bronze layer. This data is stored as-is, without any transformation.
  2. Silver Layer (Cleaned Data, as known Enriched layer): Clean and enrich the data from the Bronze layer. Apply transformations, data cleansing, and filtering to create more refined datasets.
  3. Gold Layer (Aggregated Data, as known Curated layer): Aggregate and further transform the data from the Silver layer to create high-level business tables or machine learning features. This layer is used for analytics and reporting.
What Is Z-Order (Databricks / Delta Lake)?

Z-Ordering in Databricks (specifically for Delta Lake tables) is an optimization technique designed to co-locate related information into the same set of data files on disk.

OPTIMIZE mytable
ZORDER BY (col1, col2);
What Is Liquid Clustering (Databricks)?

Liquid Clustering is Databricks’ next-generation data layout optimization for Delta Lake.
It replaces (and is far superior to) Z-Order.

## At creation time:
CREATE TABLE sales
CLUSTER BY (customer_id, event_date)
AS SELECT * FROM source;

## For existing tables:
ALTER TABLE sales
CLUSTER BY (customer_id, event_date);

## Trigger the actual clustering:
OPTIMIZE sales;

## Remove clustering:
ALTER TABLE sales
CLUSTER BY NONE;
What is broadcast? Have you used it?

Broadcast is a Spark optimization. It sends a small table to all worker nodes, so Spark can join it with a large table without shuffling the large table across the cluster.

Yes, I have used broadcast joins in Databricks to improve join performance, especially when joining a large fact table with a small dimension table.

I usually check the table size and the Spark execution plan before using it.

from pyspark.sql.functions import broadcast

result = large_df.join(
    broadcast(small_df),
    "customer_id",
    "inner"
)
What is catching and its types?

A cache is a temporary storage that holds frequently accessed data, aiming to reduce latency and enhance speed. Caching involves the process of storing data in cache memory.

What is Spark Cache / Persist (Memory Cache)

This is the standard Apache Spark feature. It stores data in the JVM Heap (Memory).

What is Databricks Disk Cache (Local Disk)

This is a Databricks-specific optimization. It automatically stores copies of remote files (Parquet/Delta) on the local NVMe SSDs of the worker nodes.

comparing .cache() and .persist()

both .cache() and .persist() are used to save intermediate results to avoid re-computing the entire lineage. The fundamental difference is that .cache() is a specific, pre-configured version of .persist().

.cache(): This is a shorthand for .persist(StorageLevel.MEMORY_ONLY). It tries to store your data in the JVM heap as deserialized objects.

.persist(): This is the more flexible version. It allows you to pass a StorageLevel to decide exactly how and where the data should be stored (RAM, Disk, or both).

How do you optimize Databricks?

When optimizing Databricks workloads, I focus on several layers. First, I optimize data layout using partitioning and Z-ordering on Delta tables. Second, I improve Spark performance by using broadcast joins, filtering data early, and caching intermediate results. Third, I tune cluster resources such as autoscaling and Photon engine. Finally, I run Delta maintenance commands like OPTIMIZE and VACUUM to manage small files and improve query performance.

Data Layout Optimization:
Partitioning:
CREATE TABLE sales
USING DELTA
PARTITIONED BY (date)

Z-Ordering:
OPTIMIZE sales
ZORDER BY (customer_id);

Liquid Clustering:

What is Photon Engine?

Photon is a high-performance query engine built in C++ that accelerates SQL queries and data processing workloads in Azure Databricks. It improves performance by using vectorized processing and optimized execution for modern hardware.

What is Data skew,

Data skew happens when some partitions have much more data than others, causing slow tasks and performance bottlenecks.

Data skew usually happens during:

  • Joins
  • GroupBy
  • Aggregations
When designing a production pipeline in Databricks, how do you diagnose and mitigate data skew or memory-related issues like Out of Memory (OOM) errors?

Answer: * Diagnosis: I look at the Spark UI. If one task takes significantly longer than others (Stage Skew) or if an executor’s memory usage spikes and drops unexpectedly, it indicates data skew. If an executor JVM dies entirely, it’s an OOM error.

I optimize partitioning using Adaptive Query Execution (AQE) or implement Liquid Clustering in Delta Lake to maintain balanced, performance-aware file sizes.

Mitigation for Skew: * If joining on a skewed key, I leverage Broadcast Joins if one table is small enough.

For larger tables, I use Skew Hints in Spark SQL (/*+ SKEW('tablename', 'columnname') */) to force Spark to salt the skewed key automatically.

Mitigation for OOM: * I review the code for anti-patterns like calling .collect() on large DataFrames.

How to fix Data Skew
  1. Salting: split one hot key into multiple keys
    for example: Add a random key to spread data across partitions.
    sample data:
    Partition 1: US (1M rows) ← Skew, slow
    Partition 2: UK (10k rows)
    Partition 3: CA (5k rows)

    doing this “Salting”
    df = df.withColumn("salt", rand() % 10)
    result:
    US_0 → 200k
    US_1 → 200k
    US_2 → 200k
    US_3 → 200k
    US_4 → 200k


    then re-partition by the new “salt” column
    df.repartition("salt")

    AFTER (Salting)
    Partition 1: US_0
    Partition 2: US_1
    Partition 3: US_2
    Partition 4: US_3
    Partition 5: US_4
  2. Better Partitioning: Repartition data using a better key.
    df.repartition(“country”)
  3. AQE:
    AQE (Adaptive Query Execution) in Spark dynamically optimizes query execution during runtime.

    How to enable AQE. It can adjust join strategies, merge small partitions, and handle data skew by splitting large partitions based on real execution statistics instead of static estimates.
    spark.conf.set("spark.sql.adaptive.enabled", "true")
How do you handle late-arriving data?

I handle late-arriving data using a combination of watermarks and incremental processing.

I allow a defined time window for late data. For records that arrive later, I use Delta Lake MERGE to insert new records or update existing ones.

I also track processing status and use reconciliation checks to make sure the data is complete and accurate.

I handle late data using:

  • Reprocessing logic for backfill if needed
  • Event-time processing (not processing-time)
  • Watermarking in Structured Streaming
  • Window-based aggregations
  • Delta Lake MERGE INTO for upserts
Difference between batch vs streaming in Databricks

Batch processing processes data in chunks at scheduled intervals, while streaming processes data continuously in near real-time.

Databricks uses Structured Streaming, which treats streaming as incremental batch processing with fault tolerance.

How do you manage cluster sizing and cost optimization?

I manage cost by:

  • Using Photon and Delta optimizations to reduce compute time
  • Using autoscaling clusters
  • Choosing right node types (memory vs compute optimized)
  • Using job clusters instead of all-purpose clusters
  • Auto-termination for idle clusters
How do you validate data quality?

I validate data quality using:

  • Row count validation
  • Null checks
  • Duplicate checks
  • Data type validation
  • Referential integrity checks
  • Business rule validation

I usually automate these checks in pipelines and log failures.

How do you monitor pipeline failures?

I monitor failures using:

  • ADF Monitor
  • Databricks job monitoring
  • Log Analytics / Azure Monitor
  • Alerts and notifications (email/Teams)
  • Custom logging tables

I also track pipeline run IDs for troubleshooting.

What metrics do you track in production pipelines?

Key production metrics:

  • Pipeline success/failure rate
  • Execution duration
  • Throughput
  • Data latency
  • Row counts
  • Error counts
  • Cluster utilization/cost
  • SLA compliance

These help identify performance or reliability issues.

How do you handle schema drift?

Schema drift happens when source schema changes unexpectedly.

I handle it by:

  • Enabling schema evolution
  • Using dynamic column mapping
  • Metadata-driven pipelines
  • Auto Loader schema inference
  • Logging and alerting schema changes
  • Separating mandatory vs optional columns
How would you secure and manage secrets in Azure Databricks when connecting to external data sources?
  1. Use Azure Key Vault to store and manage secrets securely.
  2. Integrate Azure Key Vault with Azure Databricks using Databricks-backed or Azure-backed scopes.
  3. Access secrets in notebooks and jobs using the dbutils.secrets API.
    dbutils.secrets.get(scope=”<scope-name>”, key=”<key-name>”)
  4. Ensure that secret access policies are strictly controlled and audited.
How do you design a scalable ingestion pipeline?

I design it using a layered approach (Medallion Architecture):

  • Bronze: raw ingestion (batch/streaming via ADF / Auto Loader)
  • Silver: cleaned and standardized data
  • Gold: business-ready aggregated data

For scalability:

  • Use Auto Loader for incremental file ingestion
  • Use partitioning + incremental loads
  • Decouple ingestion and transformation
  • Use Delta Lake for reliability and ACID
Scenario: You need to implement a data governance strategy in Azure Databricks. What steps would you take?

  • Data Classification: Classify data based on sensitivity and compliance requirements.
  • Access Controls: Implement role-based access control (RBAC) using Azure Active Directory.
  • Data Lineage: Use tools like Databricks Lineage to track data transformations and movement.
  • Audit Logs: Enable and monitor audit logs to track access and changes to data.
  • Compliance Policies: Implement Azure Policies and Azure Purview for data governance and compliance monitoring.
Scenario: You need to optimize a Spark job that has a large number of shuffle operations causing performance issues. What techniques would you use?
  1. Repartitioning: Repartition the data to balance the workload across nodes and reduce skew.
  2. Broadcast Joins: Use broadcast joins for small datasets to avoid shuffle operations.
  3. Caching: Cache intermediate results to reduce the need for recomputation.
  4. Shuffle Partitions: Increase the number of shuffle partitions to distribute the workload more evenly.
  5. Skew Handling: Identify and handle skewed data by adding salt keys or custom partitioning strategies.
Scenario: You need to migrate an on-premises Hadoop workload to Azure Databricks. Describe your migration strategy.
  • Assessment: Evaluate the existing Hadoop workloads and identify components to be migrated.
  • Data Transfer: Use Azure Data Factory or Azure Databricks to transfer data from on-premises HDFS to ADLS.
  • Code Migration: Convert Hadoop jobs (e.g., MapReduce, Hive) to Spark jobs and test them in Databricks.
  • Optimization: Optimize the Spark jobs for performance and cost-efficiency.
  • Validation: Validate the migrated workloads to ensure they produce the same results as on-premises.
  • Deployment: Deploy the migrated workloads to production and monitor their performance.
Can you explain the difference between running a PySpark workload using a Databricks Notebook versus deploying it as modular Python code via Databricks Jobs? When would you choose one over the other?

Answer: * Databricks Notebooks are excellent for ad-hoc exploration, rapid prototyping, and interactive data analysis. They combine markdown documentation with executable code blocks, making them highly visual.

Decision Criteria: For production ETL pipelines, I advocate for modular code deployed via Databricks Jobs. It allows us to implement proper software engineering practices, such as unit testing (via pytest), static code analysis, and robust CI/CD branch policies. Notebooks are kept strictly for initial R&D or orchestrating lightweight, high-level control flows.

Modular Python Code (e.g., packaged .py files/wheels) breaks logic down into reusable, unit-testable classes and functions.

What is the difference between df.collect() and df.take(n) or df.show()

Answer: * df.collect() pulls every single row from the distributed executors across the network and dumps it into the memory of the single Driver node, converting the Spark DataFrame into a local Python list. It is highly dangerous because if the data volume exceeds the Driver’s available RAM, it triggers an immediate OOM crash.

df.take(n) and df.show(n) only retrieve the first n rows. They are safe because they cap the memory allocation on the Driver, making them ideal for debugging or lightweight data sampling.

Migrate from Hive Metastore to Unity Catalog, what would be your step-by-step strategy to handle data migration, permissions, and governance?

Step 1 — Enable Unity Catalog
Step 2 — Create Catalog and Schema
Step 3 — Configure External Location

Step 4 — Assess Hive Tables: Check:

  • managed vs external tables
  • Delta vs non-Delta
  • table size
  • dependencies
  • downstream jobs
  • permissions

Step 5 — Convert Non-Delta Tables (IMPORTANT)
CONVERT TO DELTA parquet.`abfss://container/path`;
or
CONVERT TO DELTA hive_metastore.sales.orders;

Step 6 — Migrate Tables

CREATE TABLE finance.sales.orders
DEEP CLONE hive_metastore.sales.orders;

or 

CREATE TABLE finance.sales.orders AS
SELECT * FROM hive_metastore.sales.orders;

or 
SYNC TABLE finance.sales.orders
FROM hive_metastore.sales.orders;
SYNC works mainly for: external tables and metadata sync scenarios

Step 7 — Migrate Permissions
GRANT SELECT ON TABLE finance.sales.orders TO analysts;

How do you handle credential rotation and secure workspace access using Databricks Secrets and Azure Key Vault in a heavily locked-down or regulated financial services environment?

Answer: * Hardcoding passwords or keys in code is strictly prohibited. I create an Azure Key Vault-backed Secret Scope within Databricks.

All database passwords, API keys, and service principal secrets live inside Azure Key Vault. When Databricks runs a pipeline, it fetches these secrets securely at runtime using dbutils.secrets.get(). Credential rotation is handled upstream entirely within Azure Key Vault (often via automated Azure Functions), and Databricks automatically reflects the rotated values without requiring code changes.

What is Delta Sharing?have you used it?

Yes. Delta Sharing is an open protocol developed by Databricks for securely sharing data across different organizations, platforms, and cloud environments without requiring the recipient to copy or physically move the underlying data.

I have used Delta Sharing in Databricks environments to share Delta tables and curated datasets with downstream consumers. For example, instead of creating another physical copy of the data for a consumer, we can provide controlled access to the shared data through a Delta Share.

A key advantage is that the provider can control what data is shared and who can access it. We can share specific tables or views rather than giving consumers direct access to the underlying storage.

In a typical implementation, the provider creates a share and adds the required tables or views. The recipient is then granted access and can consume the shared data using supported clients, without needing access to the provider’s underlying ADLS or cloud storage.

I also see Delta Sharing as useful for cross-organization and cross-cloud data sharing, because the consumer doesn’t necessarily need to be on the same Databricks workspace or even the same cloud platform.

So the key point is: Delta Sharing provides governed data sharing without requiring traditional data copying or giving the consumer direct access to the underlying storage.

What is Unity Catalog Volumes?

Unity Catalog Volumes provide a governed way to manage non-tabular files in cloud storage through Unity Catalog.

in short, Delta tables are for structured/tabular data; Volumes are for files, unstructured.

Unity Catalog Volumes provide a governed way to access and manage files in cloud storage that are not necessarily Delta tables.

I have used Volumes in Databricks environments for file-based data such as documents, JSON, CSV, and other files that need to be accessed by data engineering or AI workloads.

There are two main types: managed volumes and external volumes. With a managed volume, Databricks manages the underlying storage. With an external volume, the data remains in an external cloud storage location such as ADLS Gen2, while Unity Catalog provides centralized governance and access control.

One of the main benefits is that users and workloads can access files through a governed Unity Catalog path such as /Volumes/<catalog>/<schema>/<volume>/..., rather than directly accessing cloud storage credentials or storage paths.

This is particularly useful when we need to apply centralized access control, auditing, and governance to file-based data.

So, in simple terms, Unity Catalog tables are primarily for governed structured data, while Volumes provide governed access to files.

What is the difference between a bundle and a Databricks job?

A Databricks Asset Bundle is a way to define, manage, and deploy Databricks resources as code. It uses YAML configuration files to describe resources such as jobs, pipelines, and their settings. It also supports version control and CI/CD across development, test, and production environments.

We define our jobs, notebooks, source files, and environment settings in configuration files. Then we deploy them through the Databricks CLI.

A Databricks Job is used to run and orchestrate tasks. For example, a job might execute a notebook, run a Python script, or trigger a Lakeflow pipeline. It can define task dependencies, schedules, retries, and parameters.

We store the code in Git and use Azure DevOps to automate testing and deployment.

The key difference is that a bundle manages and deploys resources, while a job executes and orchestrates data processing tasks.

This approach improves consistency, version control, and deployment reliability.

What is a Dataframe, RDD, Dataset in Azure Databricks?

Dataframe refers to a specified form of tables employed to store the data within Databricks during runtime. In this data structure, the data will be arranged into two-dimensional rows and columns to achieve better accessibility.

RDD, Resilient Distributed Dataset, is a fault-tolerant, immutable collection of elements partitioned across the nodes of a cluster. RDDs are the basic building blocks that power all of Spark’s computations.

Dataset is an extension of the DataFrame API that provides compile-time type safety and object-oriented programming benefits.


What are Synapse SQL Workspaces and how are they used?

Synapse SQL Workspaces are the environments within Azure Synapse Analytics where users can perform data querying and management tasks. They include:

  • Provisioned SQL Pools: Used for large-scale, high-performance data warehousing. Users can create and manage databases, tables, and indexes, and run complex queries.
  • On-Demand SQL Pools: Allow users to query data directly from Azure Data Lake without creating a dedicated data warehouse. It is ideal for interactive and exploratory queries.
 What is the difference between On-Demand SQL Pool and Provisioned SQL Pool?

The primary difference between On-Demand SQL Pool and Provisioned SQL Pool lies in their usage and scalability:

  • On-Demand SQL Pool: Allows users to query data stored in Azure Data Lake without requiring a dedicated resource allocation. It is best for ad-hoc queries and does not incur costs when not in use. It scales automatically based on query demand.
  • Provisioned SQL Pool: Provides a dedicated set of resources for running data warehousing workloads. It is optimized for performance and can handle large-scale data operations. Costs are incurred based on the provisioned resources and are suitable for predictable, high-throughput workloads.
 How does Azure Synapse Analytics handle data integration?

Azure Synapse Analytics handles data integration through Synapse Pipelines, which is a data integration service built on Azure Data Factory. It enables users to:

  • Ingest Data: Extract data from various sources, including relational databases, non-relational data stores, and cloud-based services.
  • Transform Data: Use data flows and data wrangling to clean and transform data.
  • Orchestrate Workflows: Schedule and manage data workflows, including ETL (Extract, Transform, Load) processes.
  • Data Integration Runtime: Utilizes Azure Integration Runtime for data movement and transformation tasks.

Can you explain the concept of “Dedicated SQL Pool” in Azure Synapse Analytics?

Dedicated SQL Pool is a provisioned, high-performance relational database.

  • Data Storage: Data must be ingested and stored internally in a proprietary columnar format. It follows a Schema-on-Write approach.
  • Architecture: Uses MPP (Massively Parallel Processing) architecture. Data is sharded into 60 distributions and processed by multiple compute nodes in parallel.
  • Cost: Billed by the hour based on the provisioned DWUs. You can pause it when not in use to save costs.
  • Best For: Stable production reporting, TB/PB scale enterprise data warehousing, and high-concurrency queries needing sub-second response.
What is Serverless SQL Pool and when would you use it?

Serverless SQL Pool is an on-demand, compute-only query engine with no internal storage.

  • Data Location: It does not store data. Data remains in the Data Lake (ADLS Gen2) in open formats like Parquet, CSV, or JSON.
  • Mechanism: Uses the OPENROWSET function to query lake files directly. It follows a Schema-on-Read approach.
  • Cost: Billed per query based on data scanned (approx. $5 USD per TB). Cost is $0 if no queries are run.
  • Best For: Rapid data discovery, building a Logical Data Warehouse, and ad-hoc data validation.

It is a managed Apache Spark 3 instance easily created and configured within Azure.

  • Managed Cluster: You don’t manage servers; you just select the node size and the number of nodes.
  • Auto-Scale & Auto-Pause: It automatically scales nodes based on workload and pauses after 5 minutes of inactivity to save costs.
  • Language Support: Supports PySpark (Python), Spark SQL, Scala, and .NET.

Can you give an example of a prompt design you used to help document a complex pipeline or generate validation test cases, including the constraints you applied?

Answer: * Effective prompt design relies on clear persona, context, and explicit constraints.

Example Prompt: “You are an expert Data Architect. Act as a technical documentation writer. Analyze the following PySpark code which performs a Type 2 Slowly Changing Dimension (SCD Type 2) merge. Write a technical markdown document explaining the data lineage, column mappings, and transformation logic. Constraints: Do not use placeholder code. Do not explain standard PySpark syntax. Format the column mappings strictly in a markdown table. Highlight the idempotency mechanics of the code.”

Using Generative AI tools responsibly to improve engineering velocity. How do you use tools like GitHub Copilot or ChatGPT to scaffold notebooks, write unit tests, or optimize slow SQL queries?

I use generative AI tools like GitHub Copilot and ChatGPT as productivity accelerators across development, testing, and optimization, but always within a controlled and validated engineering workflow.

For example, when building Databricks notebooks, I use Copilot to scaffold initial PySpark structures such as data ingestion patterns, Delta table reads/writes, and common transformation templates. This helps me quickly set up a working baseline, especially for standard ETL/ELT pipelines, while I focus on business logic, data modeling, and performance design.

For unit testing, I use ChatGPT or Copilot to generate initial PySpark or SQL test cases, such as null checks, schema validation, row count verification, and data quality rules. I then refine these tests to align with data contracts and production expectations, ensuring they are meaningful and not just syntactically correct.

For SQL optimization, I often use ChatGPT to analyze slow queries and suggest improvements like better join strategies, partition pruning, or indexing considerations. However, I always validate improvements using query execution plans, Databricks Spark UI, and actual runtime benchmarks before applying changes.

In all cases, I treat AI as an assistant rather than an authority. I ensure no sensitive or PII data is included in prompts, and all AI-generated code is reviewed, tested, and validated before production deployment. The goal is to improve engineering velocity without compromising correctness, security, or governance.

What are your strict guardrails regarding Data Governance and Security when using Generative AI tools? How do you ensure that sensitive corporate data, business logic, or PII (Personally Identifiable Information) are never leaked in a prompt?

Answer: * Data privacy is paramount, especially in financial services. My absolute rule is that no actual client data, proprietary database schemas, or PII can ever enter a commercial AI prompt.

When utilizing AI for troubleshooting or code generation, I completely anonymize and abstract the prompt. I swap out proprietary table names for generic placeholders (e.g., Table_A, Table_B), obfuscate custom column names (e.g., changing account_balance_cad to metric_1), and generate synthetic mockup rows if I need to illustrate a data structure issue.

AI can occasionally “hallucinate” code or logic. What is your process for validating AI-assisted code outputs before submitting a Pull Request (PR) for a peer review?

I never take AI-generated code at face value; it must be fully verified. My validation process includes:

Unit Testing: Verify the output against expected boundaries (checking edge cases like handling of Null values or empty DataFrames). Only after it passes automated testing do I integrate it into the codebase and open a PR.

Code Review & Linting: Check for syntax errors, deprecated Spark methods, or non-existent library parameters.

Local/Dev Execution: Run the generated code block inside a isolated scratchpad environment using a small, controlled sample dataset.


Can you talk about database locker?

Database locking is the mechanism a database uses to control concurrent access to data so that transactions stay consistent, isolated, and safe.

Locking prevents:

  • Dirty reads
  • Lost updates
  • Write conflicts
  • Race conditions

Types of Locks:

1. Shared Lock (S)

  • Used when reading data
  • Multiple readers allowed
  • No writers allowed

2. Exclusive Lock (X)

  • Used when updating or inserting
  • No one else can read or write the locked item

3. Update Lock (U) (SQL Server specific)

  • Prevents deadlocks when upgrading from Shared → Exclusive
  • Only one Update lock allowed

4. Intention Locks (IS, IX, SIX)

Used at table or page level to signal a lower-level lock is coming.

5. Row / Page / Table Locks

Based on granularity:

  • Row-level: Most common, best concurrency
  • Page-level: Several rows together
  • Table-level: When scanning or modifying large portions

DB engines automatically escalate:

Row → Page → Table
when there are too many small locks.

Can you talk on Deadlock?

A deadlock happens when:

  • Transaction A holds Lock 1 and wants Lock 2
  • Transaction B holds Lock 2 and wants Lock 1

Both wait on each other → neither can move → database detects → kills one transaction (“deadlock victim”).

Deadlocks usually involve one writer + one writer, but can also involve readers depending on isolation level.

How to Troubleshoot Deadlocks?
A: In SQL Server: Enable Deadlock Graph Capture
run:
ALTER DATABASE [YourDB] SET DEADLOCK_PRIORITY NORMAL;

use:
DBCC TRACEON (1222, -1);
DBCC TRACEON (1204, -1);
B: Interpret the Deadlock Graph

You will see:

  • Processes (T1, T2…)
  • Resources (keys, pages, objects)
  • Types of locks (X, S, U, IX, etc.)
  • Which statement caused the deadlock

Look for:

  • Two queries touching the same index/rows in different order
  • A scanning query locking too many rows
  • Missed indexes
  • Query patterns that cause U → X lock upgrades
C. Identify
  • The exact tables/images involved
  • The order of locking
  • The hotspot row or range
  • Rows with heavy update/contention

This will tell you what to fix.

How to Prevent Deadlocks (Practical + Senior-Level)
  • Always update rows in the same order
  • Keep transactions short
  • Use appropriate indexes
  • Use the correct isolation level
  • Avoid long reads before writes
Can you discuss on database normalization and denormalization

Normalization is the process of structuring a relational database to minimize data redundancy (duplicate data) and improve data integrity.

Normal FormRule SummaryProblem Solved
1NF (First)Eliminate repeating groups; ensure all column values are atomic (indivisible).Multi-valued columns, non-unique rows.
2NF (Second)Be in 1NF, AND all non-key attributes must depend on the entire primary key.Partial Dependency (non-key attribute depends on part of a composite key).
3NF (Third)Be in 2NF, AND eliminate transitive dependency (non-key attribute depends on another non-key attribute).Redundancy due to indirect dependencies.
BCNF (Boyce-Codd)A stricter version of 3NF; every determinant (column that determines another column) must be a candidate key.Edge cases involving multiple candidate keys.

Denormalization is the process of intentionally introducing redundancy into a previously normalized database to improve read performance and simplify complex queries.

  • Adding Redundant Columns: Copying a value from one table to another (e.g., copying the CustomerName into the Orders table to avoid joining to the Customer table every time an order is viewed).
  • Creating Aggregate/Summary Tables: Storing pre-calculated totals, averages, or counts to avoid running expensive aggregate functions at query time (e.g., a table that stores the daily sales total).
  • Merging Tables: Combining two tables that are frequently joined into a single, wider table.
How do you optimize slow SQL queries?

I optimize SQL by:

  • Checking execution plan first
  • Adding proper indexes (if relational DB)
  • Reducing data scanned (filter early)
  • Avoiding unnecessary joins
  • Using partition pruning in Spark/Delta
  • Using caching or materialized views
  • Optimizing joins (broadcast small tables)
What is DBT? How do you use DBT?

DBT stands for Data Build Tool. It is used to transform data in a data warehouse or lakehouse.

I use DBT to transform raw data into clean, trusted data.

First, I connect DBT to the data platform. Then, I write SQL models to clean data, join tables, and apply business rules.

I use tests to check data quality. For example, I check for null values, duplicate records, and missing keys.

I also use DBT to manage dependencies between models and generate documentation.

Finally, I use Git to manage code changes and schedule DBT jobs to run automatically.

This makes data transformation easier to maintain, test, and reuse.






Comparison of Microsoft Fabric, Azure Synapse Analytics (ASA), Azure Data Factory (ADF), and Azure Databricks (ADB)

Today, data engineers have a wide array of tools and platforms at their disposal for data engineering projects. Popular choices include Microsoft Fabric, Azure Synapse Analytics (ASA), Azure Data Factory (ADF), and Azure Databricks (ADB). It’s common to wonder which one is the best fit for your specific needs.

Side by Side comparison

Here’s a concise comparison of Microsoft Fabric, Azure Synapse Analytics, Azure Data Factory (ADF), and Azure Databricks (ADB) based on their key features, use cases, and differences:

FeatureMicrosoft FabricAzure Synapse AnalyticsAzure Data Factory (ADF)Azure Databricks (ADB)
TypeUnified SaaS analytics platformIntegrated analytics serviceCloud ETL/ELT serviceApache Spark-based analytics platform
Primary Use CaseEnd-to-end analytics (Data Engineering, Warehousing, BI, Real-Time)Large-scale data warehousing & analyticsData integration & orchestrationBig Data processing, ML, AI, advanced analytics
Data IntegrationBuilt-in Data Factory capabilitiesSynapse Pipelines (similar to ADF)Hybrid ETL/ELT pipelinesLimited (relies on Delta Lake, ADF, or custom code)
Data WarehousingOneLake (Delta-Parquet based)Dedicated SQL pools (MPP)Not applicableCan integrate with Synapse/Delta Lake
Big Data ProcessingSpark-based (Fabric Spark)Spark pools (serverless/dedicated)No (orchestration only)Optimized Spark clusters (Delta Lake)
Real-Time AnalyticsYes (Real-Time Hub)Yes (Synapse Real-Time Analytics)NoYes (Structured Streaming)
Business IntelligencePower BI (deeply integrated)Power BI integrationNoLimited (via dashboards or Power BI)
Machine LearningBasic ML integrationML in Spark poolsNoFull ML/DL support (MLflow, AutoML)
Pricing ModelCapacity-based (Fabric SKUs)Pay-as-you-go (serverless) or dedicatedActivity-basedDBU-based (compute + storage)
Open Source SupportLimited (Delta-Parquet)Limited (Spark, SQL)NoFull (Spark, Python, R, ML frameworks)
GovernanceCentralized (OneLake, Purview)Workspace-levelLimitedWorkspace-level (Unity Catalog)

Key Differences

  • Fabric vs Synapse: Fabric is a fully managed SaaS (simpler, less configurable), while Synapse offers more control (dedicated SQL pools, Spark clusters).
  • ADF vs Synapse Pipelines: Synapse Pipelines = ADF inside Synapse (same engine).
  • ADB vs Fabric Spark: ADB has better ML & open-source support, while Fabric Spark is simpler & integrated with Power BI.

When to Use Which

  1. Microsoft Fabric
    • Best for end-to-end analytics in a unified SaaS platform (no infrastructure management).
    • Combines data engineering, warehousing, real-time, and BI in one place.
    • Good for Power BI-centric organizations.
  2. Azure Synapse Analytics
    • Best for large-scale data warehousing with SQL & Spark processing.
    • Hybrid of ETL (Synapse Pipelines), SQL Pools, and Spark analytics.
    • More flexible than Fabric (supports open formats like Parquet, CSV).
  3. Azure Data Factory (ADF)
    • Best for orchestrating ETL/ELT workflows (no compute/storage of its own).
    • Used for data movement, transformations, and scheduling.
    • Often paired with Synapse or Databricks.
  4. Azure Databricks (ADB)
    • Best for advanced analytics, AI/ML, and big data processing with Spark.
    • Optimized for Delta Lake (ACID transactions on data lakes).
    • Preferred for data science teams needing MLflow, AutoML, etc.

Which One Should You Choose?

  • For a fully integrated Microsoft-centric solution → Fabric
  • For large-scale data warehousing + analytics → Synapse
  • For ETL/data movement → ADF (or Synapse Pipelines)
  • For advanced Spark-based analytics & ML → Databricks

Data Migration Checklist: A Starting Point

Creating a robust data migration checklist can be challenging, particularly for those new to the process. To simplify this, we’ve compiled a core set of essential activities for effective data migration planning. This checklist, designed to support thorough preparation for data migration projects, has been successfully used across diverse migration projects over several years, including those for financial institutions (including banks), insurance companies, consulting firms, and other industries. While not exhaustive, it provides a solid foundation that can be customized with project-specific requirements.

It is available for download as a template.

Please do not hesitate to contact me if you have any questions at William . chen @ mainri.ca

(remove all space from the email account 😊)

Locking Mechanisms in Relational Database Management Systems (RDBMS)

In relational databases, locks are essential mechanisms for managing concurrent access to data. They prevent data corruption and ensure data consistency when multiple transactions try to read or modify the same data simultaneously.

Without locks, concurrent transactions could lead to several problems. For example,

  • Dirty Reads, a transaction may read data that has been modified by another transaction but not yet committed;
  • Lost updates, one transaction’s updates may be overwritten by another transaction;
  • Non-Repeatable Reads, A transaction reads the same data multiple times, and due to updates by other transactions, the results of each read may be different;
  • Phantom Reads: A transaction executes the same query multiple times, and due to insertions or deletions by other transactions, the result set of each query may be different.

Here’s a detailed breakdown of locks in relational databases.

Types of Locks

Relational databases use various types of locks with different levels of restriction:

Shared Lock

Allows multiple read operations simultaneously. Prevents write operations until the lock is released.

Example: SELECT statements in many databases.

Exclusive Lock

Allows a single transaction to modify data. Prevents other operations (read or write) until the lock is released.

Example: UPDATE, DELETE.

Update Lock

Prevents deadlocks when a transaction might upgrade a shared lock to an exclusive lock.

Intent Lock

Indicate the type of lock a transaction intends to acquire. Intent Shared (IS): Intends to acquire a shared lock on a lower granularity level. Intent Exclusive (IX): Intends to acquire an exclusive lock on a lower granularity level.

Lock Granularity

Locks can be applied at different levels of granularity.

Row-Level Lock

Locks a specific row in a table. Provide the highest concurrency, but if many rows are locked, it may lead to lock management overhead.
Example: Updating a specific record (UPDATE ... WHERE id = 1).

Page-Level Lock

Locks a data page, a block of rows. Provide a compromise between concurrency and overhead.

(a page is a fixed-size storage unit)

Table-Level Lock

Locks an entire table. Provide the lowest concurrency but minimal overhead.

Example: Prevents any modifications to the table during an operation like ALTER TABLE.

Lock Duration

Transaction Locks: Held until the transaction is committed or rolled back.

Session Locks: Held for the duration of a session.

Temporary Locks: Released immediately after the operation completes.

Deadlocks Prevention and Handling

A deadlock occurs when two or more transactions are waiting for each other to release locks. Databases employ deadlock detection and resolution mechanisms to handle such situations.

Prevent Deadlocks

Avoid Mutual Exclusion
Use resources that allow shared access (e.g., shared locks for read-only operations).

 Eliminate Hold and Wait
Require transactions to request all resources they need at the beginning. If any resource is unavailable, the transaction must wait without holding any resources.

Allow Preemption
If a transaction requests a resource that is held by another, the system can preempt (forcefully release) the resource from the holding transaction. The preempted transaction is rolled back and restarted.

Break Circular Wait
Impose a global ordering on resources and require transactions to request resources in that order. For example, if resources are ordered as R1, R2, R3, a transaction must request R1 before R2, and R2 before R3.

    Handle Deadlocks

    If deadlocks cannot be prevented, the database system must detect and resolve them. Here’s how deadlocks are typically handled:

    Deadlock Detection
    The database system periodically checks for deadlocks by analyzing the wait-for graph, which represents transactions and their dependencies on resources. If a cycle is detected in the graph, a deadlock exists.

    Deadlock Resolution
    Once a deadlock is detected, the system must resolve it by choosing a victim transaction to abort. The victim is typically selected based on criteria such as:

    • Transaction Age: Abort the newest or oldest transaction.
    • Transaction Progress: Abort the transaction that has done the least work.
    • Priority: Abort the transaction with the lowest priority.

    The aborted transaction is rolled back, releasing its locks and allowing other transactions to proceed.

    Conclusion

    Locks are crucial for ensuring data consistency and integrity in relational databases. Understanding the different types of locks, lock granularity, locking protocols, and isolation levels is essential for database developers and administrators to design and manage concurrent applications effectively.

    Please do not hesitate to contact me if you have any questions at William . chen @ mainri.ca

    (remove all space from the email account 😊)

    Comprehensive migration engineering strategy

    What is Data Migration

    In general, data migration is the process of moving digital information. These projects are often initiated due to various reasons, such as upgrading databases, deploying new applications, or migrating from on-premises to cloud-based environments. The migration process typically involves preparing, extracting, transforming, and loading the data, usually as a one-time effort.

    Data Migration Types

    Migration types refer to the various strategies used to move databases, storage, applications, business processes, and cloud environments. Common migration types are described below. The specific type of data migration undertaken depends on business requirements.

    Database migration 

    Database migration can refer to either moving data from one database vendor to another, or to upgrading your database software to a newer version. The data format can vary between vendors so a transformation process may be required. In most cases, a change in database technology should not affect the application layer but you should definitely test to confirm.

    Storage migration 

    Storage migration involves transferring data from an existing repository to another, often new repository. The data usually remains unchanged during a storage migration. The goal is typically to upgrade to more modern technology which scales data more cost-effectively and processes data faster.

    Business process migration 

    Business process migration involves the transfer of databases and applications containing data related to customers, products, and operations. Data often requires transformation as it moves from one data model to another. These projects are usually triggered by a company reorganization, merger or acquisition.

    Application migration 

    Application migration refers to moving a software application such as an ERP or CRM system from one computing environment to another. The data usually requires transformation as it moves from one data model to another. This process most often occurs when the company decides to change to a new application vendor and/or involves transferring from on-premises to a public cloud or moving from one cloud to another.

    Cloud migration 

    Cloud migration is a frequently discussed aspect of data migration, encompassing the movement of data, applications, and other business components to a cloud computing environment, including cloud data warehouses. This migration can occur from an on-premises data center to a public cloud, or between different cloud platforms. The reverse process, known as “cloud exit,” involves migrating data and applications from the public cloud back to an on-premises infrastructure.

    Common Data Migration Challenges

    Due to the criticality of data to organizational operations, data migration is a complex process necessitating thorough risk assessment. Numerous challenges frequently arise during implementation. The following are some of the most common data migration challenges.

    • Data Loss: Data Loss: Incomplete data transmission can occur. This can result in irrevocable data loss.
    • Semantics errors: Data migration can lead to semantic errors, where the meaning or interpretation of data changes. For instance, if a source field called “grand total” is migrated to a different field or column in the target system, the data’s intended meaning is lost or distorted.
    • Extended downtime: If the migration process takes longer than anticipated, it can lead to significant disruptions and losses for your business.
    • Data corruption: Migrating unwanted data types can corrupt the target system. This can lead to system crashes or damage the data organization.
    • Performance: Performance issues can stem from poor code quality, application bugs, or an inability to handle high workloads.
    • Orchestration: Orchestration refers to the organized migration of disparate data from multiple sources to a unified location. Inadequate data migration planning can lead to the unintended creation of new data silos by failing to maintain proper tracking of data points. This issue is compounded when multiple disconnected teams operate within different departments or when functional and technical teams utilize data in a variety of ways.
    • Integration: Integrating data sources with other tools and systems allows for data sharing. However, improper integration can lead to the loss of valuable insights.
    • User training: Data migration necessitates a shift in staff focus from existing systems to a new platform. Without adequate training on the new system, users are more prone to making errors.
    • Data security: Data migration introduces significant security risks, including potential exposure to third parties and the possibility of migrating to a more vulnerable system.
    • Data quality: Poor data quality, including missing, inconsistent, useless, or incorrect data, can have significant negative consequences when migrated. These consequences include reduced target system performance, bugs, and system errors.

    Not only above mentioned challenges, but business continuity and costs are common faced challenges.

    • Business continuity: To ensure a positive user experience during data migration, minimize service disruption. When downtime or slowdowns are unavoidable, schedule migrations during off-peak hours and provide clear, timely communication to users through multiple channels, including email, in-app notifications, and social media.
    • Costs: Data migration involves various expenses, including tools, human resources, new infrastructure, and decommissioning costs for old infrastructure. Thorough budgeting is essential before starting the process. Factor in potential productivity and revenue losses due to downtime. Minimizing outages and proactive user communication can help control migration costs.

    Common migration strategy

    Several common strategies are employed for data migration, which is the process of moving data between platforms. These include:

    Big Bang data migration

    In a Big Bang migration, all data assets are moved from the source environment to the target environment in a single, comprehensive operation within a relatively short window of time. This approach necessitates system downtime during the data transfer and transformation process to ensure compatibility with the target infrastructure.

    Advantages: less costly, less complex, takes less time, all changes happen once

    Disadvantages: a high risk of expensive failure, requires downtime

    The big bang approach fits small companies or businesses working with small amounts of data. It doesn’t work for mission-critical applications that must be available 24/7.

    Trickle migration

    Trickle Migration (also known as phased or iterative migration): This strategy divides the overall migration process into smaller, manageable sub-migrations, each with its own specific objectives, timelines, scope, and quality assurance measures. By operating the old and new systems concurrently and migrating data in small increments, trickle migration achieves near-zero downtime, maintaining uninterrupted application availability for users.

    Advantages: less prone to unexpected failures, zero downtime required

    Disadvantages: more expensive, takes more time, needs extra efforts and resources to keep two systems running

    Trickle migration is the right choice for medium and large enterprises that can’t afford long downtime but have enough expertise to face technological challenges.

    Comparison of Migration strategy

    Feature/AspectTrickle MigrationBig Bang Migration
    DefinitionData and systems are migrated incrementally, in smaller phases, over time.All data and systems are migrated in one large, single event.
    ApproachIterative and gradual.One-time, all-at-once migration.
    TimelineExtended, as it spans multiple phases or iterations.Shorter, focused on a single migration window.
    RiskLower risk due to phased testing and gradual changes.Higher risk because everything changes at once.
    ComplexityMore complex due to managing coexistence of old and new systems.Simpler as there’s no coexistence of systems.
    DowntimeMinimal downtime per phase, but over a longer time overall.Typically involves a significant downtime window.
    TestingEasier to test in smaller chunks.Requires comprehensive pre-migration testing.
    User ImpactLower immediate impact, users can transition gradually.High immediate impact, users must adapt quickly.
    CostPotentially higher due to prolonged migration and dual operations.Lower due to single-event focus but risks unforeseen costs from errors.
    SuitabilityBest for large, complex systems with critical operations needing minimal disruptions.Best for smaller, less complex systems or when speed is a priority.

    Migration Process

    Data migration projects, due to their involvement with critical data and potential impact on stakeholders, present inherent challenges. Prior to any data transfer, a robust and well-defined migration plan is a necessity. A successful data migration initiative is predicated on an initial, comprehensive analysis and assessment of the data’s lifecycle. Irrespective of the specific methodology employed, all data migration projects adhere to a consistent set of key phases.

    Stage 1: Project Planning

    Prior to commencing the migration process, it is imperative to establish well-defined objectives and delineate the scope of the data migration. This process involves determining the precise data set required for transfer, including the identification and exclusion of obsolete records. Furthermore, potential compatibility issues between the source and target environments must be addressed, particularly in cases involving migration between disparate database paradigms, such as from a relational database (e.g., Oracle) to a non-relational database (e.g., MongoDB).

    This initial phase involves follow key steps:

    1.1. Define clear and measurable objectives

    Define clear and measurable objectives for the data migration project, including specifying the precise data to be migrated, defining success criteria.

    1.2. Refine the project scope

    Define the precise scope of the data migration by identifying and excluding all non-essential data elements, focusing solely on the minimum dataset necessary to ensure effective target system operation. This process necessitates a high-level comparative analysis of the source and target systems, conducted in consultation with the end-users directly impacted by the migration.

    1.3. Risk assessment

    A comprehensive risk assessment is conducted to identify potential challenges and roadblocks that could impede the data migration project. This assessment includes evaluating potential impacts on the organization and developing mitigation strategies for contingencies such as data loss, downtime, or other failures.

    1.4. Estimate the budget and set realistic timelines

    Subsequent to scope refinement and system evaluation, the appropriate migration methodology (e.g., Big Bang or Trickle) is selected, resource requirements are estimated, and a realistic project timeline is defined. It should be noted that enterprise-scale data migration projects typically require a duration of six months to two years.

    Stage 2: Discovery and Profiling

    This initial phase of the data migration methodology involves a comprehensive assessment of the data landscape. This assessment encompasses data inventory, analysis, auditing, and profiling to thoroughly examine and cleanse the data set targeted for migration. The objective is to identify and address potential data conflicts, detect and remediate data quality issues, and eliminate redundant or anomalous data elements prior to the commencement of the migration process.

    2.1. Source System Assessment

    2.1.1. Identify Data Sources
    • Primary Sources: Identify the primary sources of data, such as databases, files, APIs, etc.
    • Secondary Sources: Identify any secondary or external data sources that may need to be migrated.
    2.1.2. Understand the Data Structure
    • Data Models: Review the data models, schemas, and relationships between different data entities.
    • Data Types: Identify the types of data (e.g., text, numeric, date, binary) and their formats.
    • Data Volume: Estimate the volume of data to be migrated, including the number of records, tables, and databases.
    • Data Quality: Assess the quality of the data, including issues like duplicates, missing values, and inconsistencies.
    2.1.3. Analyze Data Dependencies
    • Interdependencies: Identify relationships and dependencies between different data entities.
    • Business Rules: Understand any business rules or logic applied to the data in the source system.
    • Data Flow: Map out how data flows through the source system, including ETL (Extract, Transform, Load) processes.
    2.1.4. Evaluate Data Security and Compliance
    • Access Controls: Review who has access to the data and what permissions they have.
    • Encryption: Check if data is encrypted at rest or in transit.
    • Compliance: Ensure the data complies with relevant regulations (e.g., GDPR, HIPAA).
    2.1.5. Document Source System
    • Metadata: Document metadata, including data definitions, formats, and constraints.
    • Data Dictionary: Create or update a data dictionary that describes the data elements in the source system.

    2.2. Target System Assessment

    2.2.1. Understand the Target System Architecture
    • Data Models: Review the data models and schemas of the target system.
    • Data Types: Ensure the target system supports the data types and formats used in the source system.
    • Storage Capacity: Verify that the target system has sufficient storage capacity for the migrated data.
    2.2.2. Evaluate Data Transformation Requirements
    • Data Mapping: Map data fields from the source system to the target system.
    • Data Transformation: Identify any transformations needed to convert data from the source format to the target format.
    • Data Validation: Plan for data validation to ensure accuracy and completeness after migration.
    2.2.3. Assess System Performance
    • Performance Benchmarks: Evaluate the performance of the target system to ensure it can handle the volume and complexity of the migrated data.
    • Scalability: Ensure the target system can scale to accommodate future data growth.
    2.2.4. Review Security and Compliance
    • Access Controls: Ensure the target system has appropriate access controls in place.
    • Encryption: Verify that data will be encrypted at rest and in transit in the target system.
    • Compliance: Ensure the target system complies with relevant regulations.
    2.2.5. Test the Target System
    • Test Environment: Set up a test environment that mirrors the target system.
    • Pilot Migration: Perform a pilot migration to test the process and identify any issues.
    • User Acceptance Testing (UAT): Conduct UAT to ensure the migrated data meets user requirements.

    2.3. Comparative Analysis of Source and Target Systems

    2.3.1. Network and Connectivity
    • Confirm bandwidth, latency, and reliability between source and target systems.
    • Address firewall or VPN requirements for data flow.
    2.3.2. Data Transformation Needs

    Determine if data needs cleansing, enrichment, or reformatting during migration.
    Plan for ETL (Extract, Transform, Load) processes if required.


    2.3.3. Testing Environments

    Establish sandbox or test environments in both systems for validation.


    2.3.4. Documentation and Communication

    Document findings and share with stakeholders to align expectations.
    Maintain clear communication between teams managing source and target systems.

    Stage 3: Resource Allocation and Solution Development

    For large data assets, a phased development approach is recommended, wherein the data is segmented, and the migration logic is developed and tested iteratively for each segment.

    3.1 Set data standards

    This will allow your team to spot problem areas across each phase of the migration process and avoid unexpected issues at the post-migration stage.

    3.2 Architecture Design and Resource Allocation

    This phase encompasses both the design of the migration architecture and the allocation of necessary resources. It is imperative to confirm the availability and commitment of all requisite resources, including internal personnel, external consultants, vendors, and enabling technologies. This verification extends to resources required for post-migration activities, such as user training and communication. Upon confirmation of resource availability, the development of the migration logic commences, encompassing the processes of data extraction, transformation, and loading (ETL) into the designated target repository.

    3.3 Create a Detailed Migration Plan
    • Data Extraction: Plan for data extraction from the source system.
    • Data Transformation: Outline the steps for data transformation.
    • Data Loading: Plan for loading data into the target system.
    • Testing: Include testing phases in the migration plan.

    stage 4: Backup and Contingency Planning

    Despite careful planning, data migration projects can face unexpected challenges. A robust backup strategy is essential to ensure data can be recovered and systems remain operational in the event of unforeseen issues during the migration process. Furthermore, detailed contingency plans should be developed to address each identified potential setback or roadblock.

    stage 5: Execution

    5.1. Pre-migration – sampling testing

    To assess the accuracy of the migration and identify any potential data quality issues, test the migration process using a representative data sample.

    5.2. User Acceptance Testing (UAT)

    User Acceptance Testing (UAT) is a critical phase in the data migration process where end-users validate that the migrated data and system meet their business requirements and expectations. UAT ensures that the migration solution works as intended in a real-world scenario before it is fully deployed. we should focus on business goals and customer satisfaction.

    5.3. Executing the Migration Solution

    Following successful completion of testing procedures, the data migration process, encompassing data extraction, transformation, and loading (ETL), is formally initiated. In a Big Bang migration scenario, the execution phase is typically completed within a period of several days. Conversely, the Trickle migration methodology employs an incremental data transfer approach, resulting in a more protracted execution timeline but significantly mitigating the risk of critical system failures and minimizing downtime.

    stage 6: Documentation and Reporting

    After completing a data migration, documentation and reporting are critical steps to ensure the process is well-documented, auditable, and provides insights for future improvements. Proper documentation and reporting help stakeholders understand the migration’s success, identify any issues, and maintain a record for compliance and reference purposes.

    6.1. Documentation

    Documentation provides a detailed record of the data migration process, including the steps taken, decisions made, and outcomes. It serves as a reference for future migrations, audits, or troubleshooting.

    Key Components of Documentation

    1. Migration Plan:
      • Include the original migration plan, including objectives, scope, timelines, and resource allocation.
    2. Data Mapping:
      • Document the mapping of source data fields to target data fields.
      • Include any transformations or conversions applied during the migration.
    3. Data Validation:
      • Record the validation rules and checks performed to ensure data accuracy and completeness.
      • Include sample validation results and any discrepancies found.
    4. Error Handling:
      • Document any errors encountered during the migration and how they were resolved.
      • Include a log of rejected or failed records and the reasons for rejection.
    5. Migration Tools and Scripts:
      • Provide details of the tools, scripts, or software used for the migration.
      • Include version numbers, configurations, and any custom code.
    6. Testing Results:
      • Document the results of pre-migration testing, including unit tests, integration tests, and user acceptance tests (UAT).
      • Include test cases, expected outcomes, and actual results.
    7. Post-Migration Verification:
      • Record the steps taken to verify the success of the migration.
      • Include checks for data integrity, completeness, and performance in the target system.
    8. Lessons Learned:
      • Summarize what went well and what could be improved in future migrations.
      • Include feedback from the migration team and stakeholders.
    9. Compliance and Security:
      • Document compliance with relevant regulations (e.g., GDPR, HIPAA).
      • Include details of security measures taken during the migration.
    10. Rollback Plan:
      • Document the rollback plan and whether it was executed (if applicable).
      • Include details of any fallback procedures used.
    6.2. Reporting

    Reporting provides a summary of the migration process and outcomes for stakeholders. It highlights key metrics, successes, and areas for improvement.

    Key Components of Reporting

    • Executive Summary:
      • Provide a high-level overview of the migration, including objectives, scope, and outcomes.
      • Highlight key achievements and challenges.
    • Migration Metrics:
      • Include quantitative metrics such as:
        • Volume of data migrated (e.g., number of records, tables, databases).
        • Time taken for the migration.
        • Number of errors or rejected records.
        • Downtime (if applicable).
    • Data Quality Report:
      • Summarize the results of data validation and quality checks.
      • Include metrics such as:
        • Percentage of accurate records.
        • Percentage of incomplete or duplicate records.
        • Number of records requiring manual intervention.
    • Performance Report:
      • Compare the performance of the target system before and after migration.
      • Include metrics such as:
        • Response times.
        • Throughput.
        • System uptime.
    • Issue and Risk Log:
      • Provide a summary of issues encountered during the migration and how they were resolved.
      • Include a risk assessment and mitigation strategies.
    • Stakeholder Feedback:
      • Summarize feedback from stakeholders, including end-users, IT teams, and business leaders.
      • Highlight any concerns or suggestions for improvement.
    • Post-Migration Support:
      • Document the support provided after the migration, including:
        • Troubleshooting and issue resolution.
        • User training and documentation.
        • Monitoring and maintenance activities.
    • Recommendations:
      • Provide recommendations for future migrations or system enhancements.
      • Include best practices and lessons learned.

    stage 7: Post-Migration Assessment Validating, Auditing and Monitor 

    7.1. Post-migration Validation and Auditing.

    Once the migration is complete, perform post-migration validation to verify that all data is accurately transferred and that the new system functions as expected. Conduct regular audits to ensure data integrity and compliance with data regulations.

    7.2. User Training and Communications

    User Training and Communications, Ongoing stakeholder communications is crucial throughout the data migration process. This should include keeping everyone informed about the migration schedule, potential disruptions, and expected outcomes, as well as providing end-user training/instructions to smooth the transition and prevent any post-migration usability issues.
    Once the migration is complete, perform post-migration validation to verify that all data is accurately transferred and that the new system functions as expected. Conduct regular audits to ensure data integrity and compliance with data regulations.

    7.3. Continuous Performance Monitoring

    Ongoing monitoring of the new system’s performance is vital for surfacing any post-migration data loss and/or data corruption issues. Regularly assess the target system’s performance and investigate any potential data-related performance bottlenecks/issues.

    7.4. Data Security and Compliance

    Last but certainly not least, ensure that data security and compliance requirements are met during and after the migration process. This may include implementing data encryption at rest and in transit, access controls, and data protection measures to safeguard sensitive information.

    Conclusion

    Assessing the source and target systems is a foundational step in ensuring a successful data migration. By thoroughly evaluating both systems, identifying potential risks, and developing a comprehensive migration plan, you can minimize disruptions and ensure that the migrated data is accurate, secure, and compliant with relevant regulations.

    Sticking to the best practices can increase the likelihood of successful data migration. each data migration project is unique and presents its own challenges, the following golden rules may help companies safely transit their valuable data assets, avoiding critical delays.

    Use data migration as an opportunity to reveal and fix data quality issues. Set high standards to improve data and metadata as you migrate them.

    Hire data migration specialists and assign a dedicated team to run the project.

    Minimize the amount of data for migration.

    Profile all source data before writing mapping scripts.

    Allocate considerable time to the design phase as it greatly impacts project success.

    Don’t be in a hurry to switch off the old platform. Sometimes, the first attempt at data migration fails, demanding rollback and another try.

    Data migration is often viewed as a necessary evil rather than a value-adding process. This seems to be the key root of many difficulties. Considering migration an important innovation project worthy of special focus is half the battle won.

    Please do not hesitate to contact me if you have any questions at William . chen @ mainri.ca

    (remove all space from the email account 😊)

    Comparison of Azure SQL Managed Instance, Azure SQL Database, Azure SQL Server

    Azure offers several SQL-related services, each tailored to different use cases and requirements. Below is a comparison of Azure SQL Managed Instance, Azure SQL Database, and Azure SQL Server (often referred to as a logical SQL Server in Azure).

    Azure SQL Database

    1. Azure SQL Database

    • Description: A fully managed, platform-as-a-service (PaaS) relational database offering. It is designed for modern cloud applications and supports single databases and elastic pools.
    • Use Cases:
      • Modern cloud-native applications.
      • Microservices architectures.
      • Applications requiring automatic scaling, high availability, and minimal management overhead.
    • Key Features:
      • Single database or elastic pools (shared resources for multiple databases).
      • Automatic backups, patching, and scaling.
      • Built-in high availability (99.99% SLA).
      • Serverless compute tier for cost optimization.
      • Limited SQL Server surface area (fewer features compared to Managed Instance).
    • Limitations:
      • No support for SQL Server Agent, Database Mail, or cross-database queries.
      • Limited compatibility with on-premises SQL Server features.
    • Management: Fully managed by Microsoft; users only manage the database and its resources.

    Azure SQL Managed Instance

    • Description: A fully managed instance of SQL Server in Azure, offering near 100% compatibility with on-premises SQL Server. It is part of the PaaS offering but provides more control and features compared to Azure SQL Database.
    • Use Cases:
      • Lift-and-shift migrations of on-premises SQL Server workloads.
      • Applications requiring full SQL Server compatibility.
      • Scenarios needing features like SQL Server Agent, cross-database queries, or linked servers.
    • Key Features:
      • Near 100% compatibility with SQL Server.
      • Supports SQL Server Agent, Database Mail, and cross-database queries.
      • Built-in high availability (99.99% SLA).
      • Virtual network (VNet) integration for secure connectivity.
      • Automated backups and patching.
    • Limitations:
      • Higher cost compared to Azure SQL Database.
      • Slightly longer deployment times.
      • Limited to a subset of SQL Server features (e.g., no Windows Authentication).
    • Management: Fully managed by Microsoft, but users have more control over instance-level configurations.

    Azure SQL Server

    Description: A logical server in Azure that acts as a central administrative point for Azure SQL Database and Azure SQL Managed Instance. It is not a standalone database service but rather a management layer.

    Use Cases:

    • Managing multiple Azure SQL Databases or Managed Instances.
    • Centralized authentication and firewall rules.
    • Administrative tasks like setting up logins and managing access.

    Key Features:

    • Acts as a gateway for Azure SQL Database and Managed Instance.
    • Supports Azure Active Directory (AAD) and SQL authentication.
    • Configurable firewall rules for network security.
    • Provides a connection endpoint for databases.

    Limitations:

    • Not a database service itself; it is a management tool.
    • Does not host databases directly.

    Management: Users manage the server configuration, logins, and firewall rules.

    Side by side Comparison 

    Feature/AspectAzure SQL DatabaseAzure SQL Managed InstanceAzure SQL Server (Logical)
    Service TypeFully managed PaaSFully managed PaaSManagement layer
    CompatibilityLimited SQL Server featuresNear 100% SQL Server compatibilityN/A (management tool)
    Use CaseCloud-native appsLift-and-shift migrationsCentralized management
    High Availability99.99% SLA99.99% SLAN/A
    VNet IntegrationLimited (via Private Link)SupportedN/A
    SQL Server AgentNot supportedSupportedN/A
    Cross-Database QueriesNot supportedSupportedN/A
    CostLowerHigherFree (included in service)
    Management OverheadMinimalModerateMinimal

    SQL Server’s Side-by-Side Feature: Not Available in Azure SQL

    Following are list that shows SQL Server have but not available in Azure SQL Database and Azure SQL Managed Instance.

    1. Instance-Level Features

    FeatureSQL ServerAzure SQL DatabaseAzure SQL Managed Instance
    Multiple Databases Per Instance✅ Full support❌ Only single database per instance✅ Full support
    Cross-Database Queries✅ Full support❌ Limited with Elastic Query✅ Full support
    SQL Server Agent✅ Full support❌ Not available✅ Supported (with limitations)
    PolyBase✅ Full support❌ Not available❌ Not available
    CLR Integration (SQL CLR)✅ Full support❌ Not available✅ Supported (with limitations)
    FileStream/FileTable✅ Full support❌ Not available❌ Not available

    2. Security Features

    FeatureSQL ServerAzure SQL DatabaseAzure SQL Managed Instance
    Database Mail✅ Full support❌ Not available❌ Not available
    Service Broker✅ Full support❌ Not available❌ Not available
    Custom Certificates for Transparent Data Encryption (TDE)✅ Full support❌ Limited to Azure-managed keys❌ Limited customization

    3. Integration Services

    FeatureSQL ServerAzure SQL DatabaseAzure SQL Managed Instance
    SSIS Integration✅ Full support❌ Requires external tools❌ Requires external tools
    SSRS Integration✅ Full support❌ Not available❌ Not available
    SSAS Integration✅ Full support❌ Not available❌ Not available

    4. Specialized Features

    FeatureSQL ServerAzure SQL DatabaseAzure SQL Managed Instance
    Machine Learning Services (R/Python)✅ Full support❌ Not available❌ Not available
    Data Quality Services (DQS)✅ Full support❌ Not available❌ Not available

    Conclusion

    • Azure SQL Database: Ideal for new cloud-native applications or applications that don’t require full SQL Server compatibility.
    • Azure SQL Managed Instance: Best for migrating on-premises SQL Server workloads to the cloud with minimal changes.
    • Azure SQL Server (Logical): Used for managing and administering Azure SQL Databases and Managed Instances.

    Please do not hesitate to contact me if you have any questions at William . chen @ mainri.ca

    (remove all space from the email account 😊)