Microsoft Fabric Updates Blog

Processing CDC streams using Fabric Eventstreams SQL

Why process database changes in real-time

Modern applications don’t just store data—they react to it. Orders are placed, inventory levels change, prices are updated. Each of these changes can be a signal that something needs to happen now: update a dashboard, trigger a workflow, or feed an operational application.

That is why many organizations are turning to real-time processing of database change data capture (CDC) events instead of waiting for batch pipelines to catch up.

Fabric Eventstreams can ingest CDC data directly from Azure SQL, PostgreSQL, MySQL, and several other databases. For relational sources, the changes are streamed into Eventstreams using Debezium, a standard CDC format.

The challenge is not getting the CDC events—it’s making sense of them. Raw CDC formats, like Debezium, force every downstream consumer to understand low-level semantics and encoding formats.

The challenge of CDC streams

Raw CDC events are rich, but verbose. They include nested before and after images, operation types, transaction metadata, and source details. While powerful, this format often forces every downstream consumer including analytics queries, alerts, operational dashboards, to understand low‑level CDC semantics and write custom JSON parsing logic.

Screenshot of JSON object showing transaction details for a sale event, including TransactionID, Timestamp, StoreID, ProductID, Quantity, and TotalAmount. The object also includes source metadata with connector metadata, source database and table information.

Figure: Example of a raw Debezium CDC event

Shape CDC events once in Eventstream using SQL

Fabric Eventstreams provides SQL operators that let you centralize CDC shaping in one place, instead of pushing that complexity to every consumer.

To see how this works, let’s work through a simple scenario involving grocery store sales and inventory changes.

Scenario: Grocery store sales and inventory changes flowing from Azure SQL DB

Imagine an Azure SQL database backing a statewide grocery system with two main tables that change with every transaction.

  • SalesTransactions – records sales and returns (mostly insert)
  • ProductInventory – tracks inventory levels as products are sold and replenished (inserts and updates)

A common requirement is to monitor inventory levels in near real-time and alert procurement teams when stocks run low.

If you connect this database to an Eventstream using the Azure SQL CDC connector and route the data directly to an Eventhouse or Lakehouse, all CDC events, across all tables, land in a single destination table as raw JSON.

Screenshot of a Eventhouse table named GrocerySalesTrackingRaw displaying raw JSON data entries related to grocery sales transactions. The interface includes a data activity tracker with a timeline graph, tabs for data preview and schema insights, and a search bar for filtering keywords within the dataset.

Figure 2: Raw CDC events in a single Eventhouse ingestion table

At this point, it becomes the user’s responsibility to:

  • Filter relevant tables
  • Parse nested JSON payloads
  • Normalize events into clean, query-able shapes

Shaping CDC event feeds with Eventstreams SQL

With Eventstreams SQL, you can transform raw CDC events into business‑ready streams using a small amount of familiar SQL.

  1. Filters for data-change (DML) events.
  2. Selects events from the ‘ProductInventory’ table.
  3. Flattens the “after” image into separate columns that reflect the source table schema.
  4. Retains key metadata like operation, source table information, timestamp etc.
SELECT
-- EXTRACT THE REQUIRED SOURCE METADATA INFORMATION
    payload.op                   AS OperationType,
    payload.source.db            AS SourceDatabase,
    payload.source.[schema]      AS SourceSchema,
    payload.source.[table]       AS SourceTable,
    payload.source.[table]       AS SourceTable,
-- EXTRACT ALL THE SOURCE TABLE COLUMNS USING A WILDCARD 
   payload.[after].* 
INTO [grocerystoreinventory-table] 
FROM [grocerystoreinventory-es-stream] 
WHERE 
    (payload.[after] IS NOT NULL OR payload.before IS NOT NULL) 
    AND payload.source.[table] = 'ProductInventory'

The result is a normalized stream where each row reflects the source table schema—no nested JSON, no custom parsing. Instead of working with opaque payloads, downstream systems can now reason about structured, meaningful data.

Screenshot of data preview displaying product inventory details including product category, event timestamp, product ID, product name, store ID, store name, location, and price. This table highlights the transformation of the raw CDC event into a shape that more closely reflects the source table schema along with some Debezium metadata.

Figure: Data preview of a normalized flattened CDC feed

Putting it all together

The previous pattern changes how teams work with CDC:

  • CDC complexity is handled once in Eventstreams.
  • Downstream consumers focus on business logic, not parsing.
  • The same normalized stream can power analytics, alerts, and applications.
  • Changes to CDC logic don’t require rewriting every consumer.

With just a small amount of SQL, raw CDC events are transformed from low-level database changes into analytics-ready streams that are easy to reason about and easy to use with:

  • Eventhouse for real-time analytics.
  • Lakehouse for historical analytics & model-training using Fabric Spark.
  • Activator to trigger alerts or workflows.

Instead of forcing every consumer to understand CDC semantics, that logic is centralized once — in SQL.

Need to do more?

In a full production system, you may have more complex requirements. You can meet all of those (and more) using simple techniques and capabilities in Eventstreams SQL.

  • Need only specific columns from a given source table? Just explicitly specify each column you need in the SELECT statement e.g. “payload.[after].StoreID AS StoreID”.
  • Want to reuse the core shaping and metadata extraction logic? Use the WITH statement to do exactly that.
  • Want to add your own custom logic when processing CDC events for a specific table? Use the WITH statement in conjunction with a SELECT statement filtered to the events for the specific table.

What’s next?

As systems grow and complexity with more tables, frequently evolving schemas, and higher event volumes, CDC processing must scale without adding operational burden.

Stay tuned for some exciting announcements in the coming weeks!

Get started today

Ready to get started with these ideas? Explore the following resources to help you get started.

Microsoft Fabric Eventstreams Overview

Add Azure SQL Database CDC source to an eventstream

Process Events Using a SQL Operator

We’d love your feedback!

If you find this blog helpful, please give it a thumbs up!

We would love to hear what real-time scenarios you’re exploring and what topics you’d like us to cover in future posts. Drop us a comment or reach out to us at askeventstreams@microsoft.com

Have new feature ideas? Submit them at Fabric Ideas – Microsoft Fabric Community

Related blog posts

Processing CDC streams using Fabric Eventstreams SQL

March 4, 2026 by Amir Jafari

We’re announcing an update to the permissions required to interact with semantic models in Fabric data agents. Today: As a creator, you must have access to the workspace where the semantic model lives and Build permission on the semantic model to add semantic model to a data agent. As a consumer, you need Read access … Continue reading “Update to required permissions for Semantic Models in Fabric Data Agents”

February 25, 2026 by Katie Murray

Welcome to the February 2026 Microsoft Fabric update! This month brings a wide range of enhancements across the Fabric platform—from improvements to the OneLake Catalog and developer experiences, to meaningful updates in Data Engineering, Data Factory, Real‑Time Intelligence, and more. Whether you’re building, operating, or scaling solutions in Fabric, there’s plenty here to explore. And … Continue reading “Fabric February 2026 Feature Summary”