Medallion Architecture Schema Evolution: Versioned Contracts, Rollback and Replay

Manage medallion schema evolution with versioned contracts, additive and breaking-change checks, compatible consumers, retained data and tested replay.

Medallion Architecture Schema Evolution: Versioned Contracts, Rollback and Replay

Author: jackey.ye · Last updated: 2026-11-24. Format capabilities in this space move quickly; verify version-specific behavior against the vendor documentation linked in each section before relying on it.

Schema evolution in a medallion architecture is a per-layer change policy, not a platform toggle: versioned source contracts at the producer boundary, an append-only bronze that preserves raw fidelity for replay, a silver that absorbs concurrent contract versions, and SemVer-style gold contracts that BI and ML consumers can pin. This article covers that discipline end to end — classification, rollout, rollback and replay — and deliberately leaves layer design and quality gates to the medallion implementation checklist hub, which is the companion resource for those decisions.

Schema drift is normal. Sources add fields, rename them, tighten nullability, and quietly redefine what a column means. What breaks teams is not the change itself but the absence of a single control point: a producer ships a new field, silver fails mid-run, gold refreshes on partial data, and nobody can say which contract version produced which rows. The sections below treat each layer as having a different obligation during a change, then give you a comparison table, a numbered rollout, and a recovery procedure for the case where a breaking change slips through anyway.

Author: jackey.ye · Last updated: 2026-11-24. Format capabilities in this space move quickly; verify version-specific behavior against the vendor documentation linked in each section before relying on it.

What Is Schema Evolution in a Medallion Architecture?

Schema evolution is the controlled process by which a source's structure changes and each layer's contract is renegotiated — distinct from schema enforcement, which rejects nonconforming data, and from table-format evolution, which is a metadata operation on stored files. The distinction matters because a platform can support the metadata operation while your pipeline still has no policy for who may change what, when, and with which consumers notified.

Databricks' medallion architecture guidance assigns each layer a different job, and those jobs imply different evolution obligations. Bronze ingests raw data with no cleanup or validation, maintains the raw state of the source in its original formats, is appended incrementally, serves as the single source of truth preserving fidelity, and enables reprocessing and auditing by retaining historical data. Silver is where Databricks places schema enforcement, handling of null and missing values, deduplication, resolution of late-arriving data, data quality checks, schema evolution and type casting. Gold holds aggregated, business-aligned datasets for BI, ML and applications.

Read together, those responsibilities produce the split this article uses throughout:

  • Bronze absorbs change. It should accept new shapes without failing, because Databricks explicitly advises against writing to silver directly from ingestion — doing so introduces failures from schema changes or corrupt records in sources.

  • Silver interprets change. It is the layer that decides what a new field means, casts types, deduplicates, and quarantines what it cannot validate.

  • Gold promises stability. Its consumers — dashboards, semantic models, feature definitions — need a contract they can pin, not a table that shifts underneath them.

Six terms recur. A source contract is the agreed definition of a source's fields, types, nullability, defaults, semantics, owner and version. A contract version is an immutable identifier for one such definition. An additive change preserves every existing reader's ability to interpret both old and new data; a breaking change alters or removes something an existing reader depends on. A compatibility window is the negotiated period during which an old and new version coexist. Replay is reprocessing retained raw data through a corrected transformation.

Versioned Source Contracts: The Control Point Before Bronze

Version the contract at the producer boundary, not at silver. If the first place a structural change is detected is a failed silver job, you have already lost the ability to attribute the failure to a specific producer release, and you have no record of what the data looked like before the change.

A usable source contract records, at minimum: field names, types, nullability, defaults, the semantic meaning of each field, the owning team, and a version identifier. Schema registries operationalize the mechanical half of this. Confluent Schema Registry assigns each schema version a unique ID and an incremented version number, and when a schema is updated it checks compatibility before accepting the new version; the default compatibility mode is BACKWARD.

Avro supplies the resolution mechanics that make those checks meaningful. A field default is used only when reading instances that lack the field, and the specification is careful to note that the presence of a default value does not make the field optional at encoding time. Aliases provide alternate names, which is how invalid type or field names can be corrected by renaming. Most importantly, binary-encoded Avro data carries no type information or field names, so the specification states that files or systems storing Avro data should always include the writer's schema for that data.

The practical implication is that a registry check is necessary but not sufficient. It validates structure, not business meaning: a registry will happily accept a field whose name and type are unchanged while the producer has started populating it with a different unit or a different definition. That judgment belongs to the contract owner, and it is the reason the next section separates mechanical compatibility from semantic compatibility.

Record the contract version alongside the ingested data — a metadata column on every bronze row or batch — so that any record can be traced to the contract that produced it. Combined with ingestion timestamp and source file or offset, this is what makes blast-radius analysis possible during an incident.

Additive vs. Breaking Changes: A Decision Framework

Test every proposed change against one question before it reaches silver: can an existing reader still interpret both the data it already has and the data it will now receive? If yes, the change is additive. If no, it is breaking and needs a version, a migration path and a deprecation window.

Additive changes include a new nullable field with a default, a widened numeric type where the format supports the widening, and a new enum symbol that the reader's schema handles through a default. Breaking changes include field removal, rename, type narrowing, nullability tightening, and semantic redefinition under an unchanged name.

The semantic case deserves emphasis because no schema check catches it. dbt's model versioning guidance describes exactly this: a column can be recalculated in a way that does not change its name, data type or enforceable characteristics, yet substantially changes the results downstream queriers see. dbt calls this always a judgment call for the model maintainer. In contract terms, the owner must make that call explicitly and in writing, because the registry cannot.

Compatibility modes are the mechanical check. Confluent documents BACKWARD as meaning consumers using the new schema can read data produced with the last schema, and notes that FULL_TRANSITIVE is the choice when the new schema must be forward and backward compatible with all registered schemas, not just the last two. Under NONE, compatibility checks are disabled, and Confluent states the consequence plainly: you must either upgrade all producers and consumers to the new schema at the same time or create a brand-new topic and migrate.

That same fork — upgrade everything together, or fork the stream and migrate — reappears at every layer. At silver it becomes versioned models side by side; at gold it becomes a major version bump with a deprecation date. Deciding which branch you are on is the classification step, and it should produce a written record with owner sign-off, not a Slack message.

Schema-Change Types and Layer Responses

The table below maps common change types to each layer's response and to an automation level. Read the bronze, silver and gold columns as policy, and the automation column as a default that your governance may tighten. The format capabilities referenced are what the table formats permit, not what your organization should allow by default.

Change type

Classification

Bronze response

Silver response

Gold response

Automation

Add nullable field with default

Additive

Land as received; record new contract version

Normalize; expose column; backfill default for historical rows

Minor version bump if the column is published

Auto, if registry check passes

Add required field without default

Breaking

Land as received

Cannot populate historical rows; quarantine or hold

Major version bump; consumers must migrate

Coordinated release

Rename field

Breaking

Land as received; both names may appear

Map old and new names to one canonical column via alias or view

Major bump if the published name changes

Gated (approval)

Drop field

Breaking

Retain raw column in historical batches

Stop projecting; keep in quarantine for the window

Major bump; remove from contract manifest

Gated (approval)

Widen type

Additive (conditional)

Land as received

Cast to the wider type; verify no precision loss

Minor bump only if the published type changes

Auto, within supported matrix

Narrow type

Breaking

Land as received

Reject or quarantine values that do not fit

Major bump

Coordinated release

Change nullability (nullable → required)

Breaking

Land as received

Validate; quarantine nulls rather than dropping

Major bump

Coordinated release

Change semantic meaning, same name

Breaking

Land as received

Requires an explicit owner decision and a new canonical mapping

Major bump even if SQL shape is unchanged

Coordinated release

Reorder fields

Additive (metadata)

No effect on stored values

No effect if columns are tracked by ID or name

No change

Auto

Change enum symbols

Conditional

Land as received

Map unknown symbols to a default or quarantine

Minor bump for new symbols; major if a symbol is removed

Auto with default; gated without

Format capabilities constrain what is mechanically possible. Iceberg supports add, drop, rename, widen and reorder as metadata changes, so no data files need to be rewritten, and it guarantees those changes are independent and free of side effects by tracking each column with a unique ID — an added column is assigned a new ID so existing data is never read by mistake.

Delta Lake reaches similar outcomes differently. Column mapping lets Delta table columns and the underlying Parquet file columns use different names, which enables RENAME COLUMN and DROP COLUMNS without rewriting the underlying Parquet files; enabling it is an irreversible protocol upgrade, and the documentation lists known limitations including blocked or schema-tracking-dependent Structured Streaming reads after renames or drops. Delta type widening supports a specific widening matrix that expands in Delta 4.0, and promotions from byte, short, int or long to decimal or double must be committed manually to avoid accidental promotion of integers to decimals.

A worked example makes the table concrete. Suppose a producer adds shipping_cost as a nullable decimal with a default of null. Bronze lands it untouched and stamps the new contract version. Silver adds the column, backfills historical rows with null, and exposes it to gold. Gold publishes a minor version if the column is part of the published contract. If the same producer later redefines shipping_cost to include tax without renaming it, nothing in the format layer objects — the column is still a decimal — but the classification is breaking, silver needs an explicit mapping decision, and gold needs a major bump. The format permitted both changes; only the contract policy distinguished them.

Bronze Raw Retention: Designing the Replay Substrate

Bronze must retain enough to reconstruct any batch exactly as received, because replay is only possible if the evidence survives the incident. Databricks' bronze characteristics are the design brief: raw state in original formats, appended incrementally, preserving fidelity, retaining all historical data for reprocessing and auditing. Its guidance to store most fields as string, VARIANT or binary exists specifically to protect against unexpected schema changes.

Four things need to be retained per batch:

  1. The payload as received, in its original format, without type coercion.

  2. The writer's schema or contract version, following the Avro specification's advice that stored data should always include the writer's schema.

  3. Ingestion metadata — source system, file name or offset, ingestion timestamp, and batch identifier. Databricks notes metadata columns such as _metadata.file_name may be added for provenance.

  4. A transaction identifier so that a replayed batch can be made idempotent rather than duplicated.

The failure mode this prevents is specific: if bronze coerces types on ingest, a bad cast destroys the evidence needed to replay. A timestamp parsed with the wrong format, an integer truncated on the way in, or a decimal rounded at landing cannot be recovered from bronze because bronze no longer holds the original. Keeping the raw representation defers interpretation to silver, where it can be corrected and re-run.

Retention period is a policy decision, not a default. Set it from two inputs: the replay window your incident response actually needs, and the compliance obligations that govern the source data. A retention period shorter than your longest realistic detection-to-recovery interval makes replay impossible for exactly the incidents that matter most. The trade-off is storage cost, which grows with append-only history; that cost is the price of the replay capability, and it should be budgeted as such rather than trimmed reactively. This section covers retention design only — for bronze quality gates and promotion criteria, use the medallion implementation checklist hub.

Silver Compatibility: Handling Concurrent Contract Versions

Assume multiple contract versions will arrive at once, because during any migration window they will. Silver needs a strategy for coexistence, not a hope that producers cut over cleanly.

Three patterns work, and they compose:

  • Version-tolerant tables. Carry a contract_version column on silver rows and normalize every known version to one canonical shape. New versions are handled by extending the normalization logic, not by rebuilding the table. This is the lowest-friction option when changes are additive.

  • Versioned models side by side. Follow dbt's model-version pattern: a latest version resolves by default when no pin is specified, older versions remain pinnable, and a deprecation_date gives consumers a known migration boundary. dbt's documentation is candid about the trade-off — materializing multiple versions costs storage and clutter, and frequent downstream migration has its own cost, but a deprecation date puts a known boundary on that cost.

  • Quarantine, never silent drops. Records that fail validation under every known version go to a quarantine table with the failure reason and the contract version they claimed. A silent drop is indistinguishable from data that never arrived.

Compatibility-mode choice should follow upgrade order per subject. BACKWARD suits the case where consumers upgrade first, since consumers using the new schema can read data written with the previous one. FORWARD suits producers upgrading first. FULL and FULL_TRANSITIVE apply when compatibility must hold in both directions, with FULL_TRANSITIVE required when the new schema must be compatible with all registered schemas rather than just the last two. Confluent notes that the configured compatibility type has a direct implication for the order in which producers and consumers are upgraded, so the mode is an operational decision, not a checkbox.

One boundary is worth restating: Databricks places schema enforcement and schema evolution in silver and advises against writing to silver directly from ingestion. The contract boundary therefore belongs at bronze, and silver's job is to interpret versions it already has on hand — not to be the first line of defense against a producer's surprise.

Gold Semantic Versioning: Stable Contracts for BI and ML

Version gold outputs so consumers can pin, and treat Semantic Versioning as an analogy rather than a standard that governs data. SemVer 2.0.0 defines its rules for a public API; a gold table is an API in the practical sense — dashboards, semantic models and feature definitions depend on its columns, types and metric definitions — so the mapping is useful even though SemVer itself does not apply to datasets.

Apply the analogy as follows:

  • Major — a breaking change to columns, types or metric definitions. A metric redefinition earns a major bump even when the SQL shape is unchanged, because the numbers consumers see will move.

  • Minor — additive columns or new metrics that existing consumers can ignore.

  • Patch — a bug fix that changes values without changing shape.

dbt's model versions and deprecation_date provide a working template for the lifecycle: develop a new version, bump latest, slate the old version for deprecation, update downstream references, then remove the old version. dbt also warns that governance features add structure and can make rollbacks harder if adopted too early — a reason to introduce versioning when external consumers actually depend on the model, not before.

Operationally, publish a gold contract manifest: the version, the column list with types, the metric definitions, the owner, and the deprecation date of any prior version. BI semantic layers and ML feature definitions then pin to a manifest version rather than to a table name. The deprecation window is a negotiated duration between producer and consumers, not a unilateral notice; its length should reflect how long the slowest consumer realistically needs to migrate.

The reason metric redefinition deserves a major bump is that it is invisible to schema checks. A column named revenue that changes from gross to net passes every structural test and silently changes every downstream number. Versioning the definition, not just the shape, is what makes the promise to consumers meaningful.

Rollout: A Numbered Procedure with Expected Outcomes

Run the rollout in this order. Each step names its checkpoint and what done looks like; skipping a step moves the risk downstream rather than removing it.

  1. Classify the change against the contract and the comparison table. Checkpoint: the classification is written down and the contract owner has signed off, including an explicit judgment on semantic change. Done when the record exists in source control alongside the contract.

  2. Run the registry compatibility check at the strictest mode the consumer set requires. Checkpoint: pass or fail before any data moves. Done when the result is recorded against the proposed version, and a fail stops the rollout here.

  3. Land the change in bronze with the contract version recorded. Checkpoint: new-shape records arrive with the new version stamped and ingestion metadata populated. Done when a sample batch is replayable and attributable to its producer release.

  4. Deploy silver under a new model version alongside the old. Checkpoint: both versions are queryable and the quarantine rate is observable. Done when the new version runs on live data without blocking the old one.

  5. Validate silver outputs against the old version on overlapping data. Checkpoint: a documented diff, including any intentional semantic changes. Done when the diff has been reviewed by the contract owner and unexpected differences are explained.

  6. Publish the gold version bump and deprecation date. Checkpoint: the manifest is updated and consumers have a pinned target and a migration deadline. Done when downstream references point at a pinned version rather than a floating one.

  7. Retire the old version after the window closes. Checkpoint: no live consumer references the retired version. Done when one live contract per gold model remains.

Steps 1 and 5 are the ones teams skip under deadline pressure, and they are the two that catch semantic breakage. A mechanical registry pass at step 2 says nothing about whether the numbers downstream will move.

Rollback and Replay When a Breaking Change Slips Through

Recovery depends entirely on bronze retention. If bronze holds the raw payload, the contract version and the ingestion metadata, you can reconstruct any affected batch; if it does not, the procedure below stops at step two.

  1. Freeze downstream. Pause gold refreshes and consumer jobs so bad output stops propagating while you work.

  2. Identify the blast radius. Use the contract version and ingestion metadata to find every batch produced under the offending version, and every silver and gold table that consumed them.

  3. Roll back the silver model to the prior version. Pin the previous model version, or use table-format time travel or snapshot rollback. Iceberg commits swap table metadata atomically and roll back if a job produces bad data, which makes this a metadata operation rather than a rebuild.

  4. Replay from bronze into the corrected silver version. Write idempotently so a repeated write is a no-op rather than a duplicate. Delta's transaction identifiers carry an application ID and version, and a job checks the latest committed version for its application before writing; Iceberg takes the optimistic-concurrency route, retrying a failed metadata swap against the new table state.

  5. Verify against a known-good batch. Assert row counts and key values match what the prior version produced on overlapping data. Done when the assertions pass and the diff is documented.

  6. Re-promote gold. Refresh gold from the corrected silver and confirm the reconciliation checks pass before consumers resume.

  7. Tighten the contract check that should have caught it. Add the missing test, compatibility rule or semantic review to the contract, and record the incident against the change type that caused it.

One honest limit: replay restores data, not decisions. Dashboards that displayed bad gold output, models trained on it, and reports circulated from it need their own review — a replayed table does not retract a decision already made on the wrong numbers. Budget for that review as part of the incident, not after it.

Which Changes to Automate and Which Need a Coordinated Release

Automate the mechanical check; never automate the semantic judgment. The classification below complements the comparison table rather than replacing it — use it to decide how much human process a given change needs.

Auto-eligible, provided the registry check passes and silver normalizes: additive nullable fields with defaults, supported type widenings within the format's documented matrix, and new enum symbols that resolve through a default. These are changes where an existing reader can still interpret both old and new data, so the risk is confined to whether the mechanical check passes.

Gated — automated with approval: renames and drops where the format supports metadata-only evolution. Iceberg and Delta column mapping both make these mechanically safe, which is precisely why they are dangerous: the operation succeeds, the pipeline keeps running, and a downstream consumer silently loses a column. Require an approval that names the affected consumers.

Coordinated release: required-field additions, type narrowing, nullability tightening, semantic redefinitions, and any change accepted under NONE compatibility. These need producer and consumer upgraded together, or a new topic or table with a migration path — the same fork Confluent describes for NONE. There is no safe automated path because the old and new versions cannot coexist in the same stream without interpretation.

The principle holds across all three: the registry, the table format and the pipeline can verify structure. Only the contract owner can verify meaning, and that step stays manual by design.

Where This Fits in Your Platform

The requirements this article implies are properties to evaluate in any lakehouse, not features unique to one vendor: open table formats with metadata-only evolution, time travel or snapshot rollback, idempotent writes, and a place to record contract versions alongside ingested data. Ask for each of those explicitly during evaluation, and test them against a change type from the comparison table rather than accepting a feature list.

Singdata Lakehouse is built on Apache Iceberg and stores data in open formats in your own object storage, so bronze, silver and gold can live as separate schemas over one copy of data; its incremental compute model affects the cost of replaying a large bronze history. Evaluate it, and any alternative, against the acceptance checks in this article and reproduce vendor-reported performance figures in your own environment before relying on them. The platform overview documents the architecture.

Frequently Asked Questions

How do I decide whether a schema change is additive or breaking before it reaches silver?

Ask whether an existing reader can still interpret both the data it already has and the data it will now receive. If yes, it is additive; if no, it is breaking. Run the registry compatibility check as the mechanical confirmation, but make the semantic call separately — a column recalculated without changing its name or type can still substantially change downstream results, and that judgment belongs to the contract owner. The decision framework develops this in full.

What should bronze retain so I can replay after a bad schema change?

Retain the payload as received in its original format, the writer's schema or contract version, ingestion metadata (source, file or offset, timestamp, batch identifier), and a transaction identifier for idempotent replay. Databricks recommends storing most fields as string, VARIANT or binary to protect against unexpected schema changes. The critical failure mode to avoid is type coercion at ingest, which destroys the evidence replay depends on. See bronze raw retention.

How should silver handle multiple concurrent source contract versions?

Carry a contract_version column and normalize every known version to one canonical shape; run versioned models side by side with a latest that resolves by default and older versions pinnable during a deprecation window; and quarantine records that fail validation under any known version rather than dropping them silently. Choose the compatibility mode per subject according to upgrade order — BACKWARD when consumers upgrade first, FORWARD when producers do. See silver compatibility.

How do I version gold outputs so BI and ML consumers can pin to a stable contract?

Apply SemVer as an analogy: major for breaking changes to columns, types or metric definitions; minor for additive columns or new metrics; patch for value-only fixes. Publish a contract manifest with the version, column list, metric definitions, owner and deprecation date, and have semantic layers and feature definitions pin to a manifest version rather than a table name. A metric redefinition earns a major bump even when the SQL shape is unchanged. See gold semantic versioning.

What is the rollback and replay procedure when a breaking change slips through?

Freeze downstream jobs, identify the blast radius via contract version and ingestion metadata, roll silver back to the prior version using version pinning or table-format time travel, replay from bronze with idempotent writes, verify row counts and key values against a known-good batch, then re-promote gold. Finish by tightening the contract check that should have caught the change. Remember that replay restores data, not decisions — dashboards and models that consumed bad output need their own review. See rollback and replay.

Further Reading and Sources

These are the primary references behind the format capabilities and compatibility rules cited above. Verify version-specific behavior against the current documentation before relying on it, since table-format features change between releases.

Author: jackey.ye · Last updated: 2026-11-24.

For a related implementation check, see the event-time SCD Type 2 correction workflow.

Related Articles