DataEng Hub
Azure storage & FabricintermediateArticle · 9 min read

Medallion Architecture in a Fabric Lakehouse

Build bronze, silver and gold in one Fabric lakehouse with schemas and materialized lake views, plus the gotchas that hit in production.

Balaji S.
Lead Data Engineer

Medallion series, part 2. Part 1 covered the same pattern on Databricks.

TL;DR

  • In Fabric, bronze, silver and gold are schemas or lakehouses in OneLake. The layers mean the same thing as on Databricks; the plumbing is different.
  • Start with one schema-enabled lakehouse and three schemas. Split into a lakehouse or workspace per layer when access rules or teams diverge.
  • Materialized lake views (GA since March 2026) let you write silver and gold as SELECT statements. Fabric works out the run order, the refresh type and the data quality report.
  • New workspaces default to the writeHeavy Spark profile with V-Order off. That suits bronze and silver, and it can make Direct Lake reports on gold slower than they need to be.
  • Most production pain comes from two places: the SQL analytics endpoint lagging behind Spark, and capacity units burned by notebooks that were never sized.

The problem

NorthBridge Retail (a fictional retailer) moved its reporting to Fabric last quarter. The team did what most teams do first: one lakehouse, forty tables, names like orders_final_v2. Pipelines copied files in, notebooks cleaned them, and Power BI read whatever looked finished.

Then a store manager asked why Monday's revenue was double. A copy activity had re-run after a timeout, and the report was reading the raw table directly. Nobody could say which tables were safe to build on.

That is the problem medallion solves. It is a contract: bronze is what arrived, silver is what you trust, gold is what the business reads. If you have built this on Databricks, the thinking carries over. What changes in Fabric is where the layers live, how you move data between them, and how gold reaches Power BI.

Key concepts

A notebook or pipeline lands raw data in bronze. Materialized lake views build silver and gold from it, and reports read gold only.

Concept What it means Why it matters here
OneLake The single data lake under every Fabric workspace All three layers sit in it as Delta tables, so there is no storage account to design
Lakehouse schemas Folders of tables inside one lakehouse, such as bronze, silver, gold The simplest way to separate layers, and required for materialized lake views
Shortcut A pointer to data in ADLS Gen2, S3, Google Cloud or another OneLake item Bronze can reference source files without copying them
Materialized lake view (MLV) A Delta table defined by a SELECT and refreshed by Fabric Replaces most silver and gold notebooks plus the pipeline that ordered them
SQL analytics endpoint A read-only T-SQL view of the lakehouse tables How analysts query gold, and it syncs with a delay
Direct Lake Power BI reading Delta files straight from OneLake Fast only when gold files are laid out for it
V-Order A write-time Parquet optimization for Fabric readers Off by default in new workspaces; gold usually wants it on

Step-by-step implementation

Environment for all code: Fabric Runtime 1.3 (Spark 3.5, Delta Lake 3.2), a notebook attached to the lakehouse nbr_lakehouse.

Step 1 — Create one lakehouse with three schemas

Create a lakehouse and tick Lakehouse schemas in the dialog. You cannot switch this on later, and materialized lake views need it. Then create the layers.

CREATE SCHEMA IF NOT EXISTS bronze;
CREATE SCHEMA IF NOT EXISTS silver;
CREATE SCHEMA IF NOT EXISTS gold;

Microsoft's guidance leans towards a lakehouse per layer, each in its own workspace, for tighter governance. One lakehouse with schemas is the right starting point for a small team. Moving a schema to its own lakehouse later is a copy job, not a redesign.

Step 2 — Land raw data in bronze

Bronze keeps what arrived, plus two columns that tell you when and from where. Every column stays a string; typing is silver's job.

from pyspark.sql import functions as F
 
raw = (spark.read
    .option("header", True)
    .csv("Files/landing/orders/2026-11-10/"))
 
(raw.withColumn("_ingested_at", F.current_timestamp())
    .withColumn("_source_file", F.col("_metadata.file_path"))
    .write.mode("append")
    .saveAsTable("bronze.orders_raw"))
 
spark.sql("""
ALTER TABLE bronze.orders_raw
SET TBLPROPERTIES (delta.enableChangeDataFeed = true)
""")

The last statement matters more than it looks. Without change data feed on the source, every downstream view recomputes in full on each run.

If the files already sit in ADLS Gen2 or S3, create a shortcut under Files and read from that path. You skip the copy and the storage bill for a second set of files.

Step 3 — Build silver as a materialized lake view

Silver casts types, removes duplicate loads and applies quality rules. With an MLV, that is a single statement.

CREATE OR REPLACE MATERIALIZED LAKE VIEW silver.orders
(
  CONSTRAINT order_id_present CHECK (order_id IS NOT NULL) ON MISMATCH DROP,
  CONSTRAINT amount_not_negative CHECK (amount >= 0) ON MISMATCH FAIL
)
TBLPROPERTIES ("delta.enableChangeDataFeed" = "true")
AS
SELECT
  CAST(order_id AS BIGINT)                          AS order_id,
  MAX(CAST(store_id AS INT))                        AS store_id,
  MAX(TO_DATE(order_date, 'yyyy-MM-dd'))             AS order_date,
  MAX(CAST(amount AS DECIMAL(12,2)))                 AS amount,
  MAX(_ingested_at)                                  AS last_ingested_at
FROM bronze.orders_raw
GROUP BY CAST(order_id AS BIGINT);

DROP removes bad rows and carries on. FAIL stops the refresh, and it is the default if you leave the clause out. Use DROP for noise you expect and FAIL for anything that would make a report wrong.

The GROUP BY is deliberate. It collapses the same order loaded twice, which is exactly what bit NorthBridge. The usual ROW_NUMBER() dedup also works, but window functions and DISTINCT force a full refresh every time.

Step 4 — Build gold for the report

Gold answers one business question per table. Here it is revenue by store and day.

CREATE OR REPLACE MATERIALIZED LAKE VIEW gold.daily_store_sales
TBLPROPERTIES ("delta.parquet.vorder.enabled" = "true")
AS
SELECT
  order_date,
  store_id,
  COUNT(*)    AS order_count,
  SUM(amount) AS revenue
FROM silver.orders
GROUP BY order_date, store_id;

SUM, COUNT, MIN and MAX refresh incrementally. AVG and STDDEV only do so when the source tables are partitioned and the partition column is in the GROUP BY. If you need an average in gold, store the sum and the count and divide in the semantic model.

Step 5 — Schedule and check

Open the lakehouse, go to Materialized lake views > Manage, and you will see the lineage Fabric built from your FROM clauses. Add a schedule under Manage schedules. Fabric refreshes silver before gold without being told.

On each run it picks one of three paths per view: skip (nothing changed), incremental, or full. To force a rebuild after a logic change:

REFRESH MATERIALIZED LAKE VIEW gold.daily_store_sales FULL;

From production: gotchas and lessons

  1. Symptom: The refresh finished at 6:05, but the 6:10 report still shows yesterday. Cause: The SQL analytics endpoint syncs lakehouse metadata in the background. Spark sees new data at once; T-SQL readers may not. Fix: Call the endpoint's refreshMetadata REST API as the last pipeline step, before anything that reads through T-SQL.
  2. Symptom: Every scheduled run takes as long as the first one. Cause: The view is refreshing in full. Either change data feed is off on a source, or the SELECT uses a window function, DISTINCT or current_timestamp(). Fix: Turn on change data feed for every source table and view. Move non-deterministic columns such as load timestamps into bronze.
  3. Symptom: Silver has fewer rows than bronze and nobody noticed for a week. Cause: ON MISMATCH DROP did its job quietly. Fix: Read the data quality report after each run and alert on dropped-row counts. Keep DROP for rules where losing the row is acceptable.
  4. Symptom: A setting works when you run the notebook by hand and is ignored overnight. Cause: Scheduled MLV refreshes do not apply session properties set with spark.conf.set. Fix: Put Spark settings in the environment or workspace configuration, or in the view's TBLPROPERTIES.
  5. Symptom: CREATE MATERIALIZED LAKE VIEW fails on a query that runs fine by itself. Cause: The definition references a temporary view, a UDF or Delta time travel, none of which are allowed. Fix: Inline the logic as a CTE, or keep that step in a notebook and let the MLV read its output table.

Performance and cost notes

Fabric bills capacity units, not clusters, so a careless silver notebook slows down everyone's reports on the same capacity. Four settings do most of the work.

  • Spark profile. New workspaces default to writeHeavy: V-Order off, tuned for ingestion. Leave it for bronze and silver. For gold tables read through Direct Lake, turn V-Order on at table level or use the readHeavyForPBI profile.
  • Do not V-Order everything. It makes writes slower. Microsoft's own guidance is to enable it only where Direct Lake is the main consumer, not for Spark or SQL endpoint reads.
  • Skip partitioning by default. Target files of 128 MB to 1 GB and use liquid clustering on silver and gold only when a measured filter needs it. Small partitioned tables are the most common self-inflicted slowdown.
  • Let refresh be lazy. With change data feed on, a view with no new source commits is skipped entirely. That is free capacity back every hour.

Run VACUUM on its own schedule. The default keeps seven days of removed files; shorten it only after checking who relies on time travel.

When not to use this

  • One source, one report, one analyst. Three layers for a single spreadsheet feed is ceremony. A bronze table and one gold view are enough until a second consumer shows up.
  • Your team thinks in T-SQL. Keep bronze and silver in the lakehouse and put gold in a Fabric Warehouse. You get stored procedures, multi-table transactions and a layout the engine manages for you.
  • You need MERGE, SCD Type 2 or Python logic. MLVs have no INSERT, UPDATE or DELETE and no UDFs. Write those tables from notebooks and let MLVs handle the simpler joins and aggregates around them.
  • Data must be fresh within seconds. Scheduled view refreshes are batch. Streaming belongs in Real-Time Intelligence or Spark Structured Streaming.

Checklist

  • Lakehouse created with schemas enabled
  • Bronze is append-only and carries _ingested_at and _source_file
  • Change data feed is on for every table and view that feeds an MLV
  • Each silver rule is a named constraint with a deliberate DROP or FAIL
  • Gold tables read by Direct Lake have V-Order on
  • SQL endpoint metadata refresh runs before T-SQL consumers
  • Reports and semantic models point at gold only
  • VACUUM is scheduled and the retention period is agreed

Practice

  • Try: rebuild silver.orders with ROW_NUMBER() instead of GROUP BY, run the schedule twice, and compare the refresh type Fabric chose each time.
  • Try: add a silver.stores view and a gold.sales_by_region view, then check that the lineage orders them correctly without a pipeline.

Further reading

Previous in this series: Medallion Architecture on Databricks, End to End.

#fabric#medallion#lakehouse#onelake#materialized-lake-view

Keep going

PDF guide6 pages · v1.0

Medallion Architecture Checklist

A printable checklist for designing and reviewing bronze, silver and gold layers — naming, quality gates, ownership and the questions to ask at each hop.

One practical note a week

Get new articles, problems and guides in your inbox.