Schema evolution is the practice of changing the structure of data over time, such as adding, removing, renaming or retyping fields, without breaking the systems that write, store and read that data. In data engineering, it is the discipline that lets a data pipeline, a data lake table or an event stream absorb new business requirements while older records and older consumers remain valid.
The concept matters because data outlives code. A table written five years ago may still be queried today, and a message produced by one service version may be read by several newer ones. Schema evolution defines which changes are safe, how they are declared and versioned, and how storage formats and readers reconcile old and new shapes of the same data.
How schema evolution reconciles old and new data
Schema evolution works by keeping a writer schema and a reader schema and resolving differences between them at read time or at write time. When a reader encounters a record written with an older schema, the format or engine applies resolution rules: a missing field receives its declared default value, an unknown field is ignored, and a widened numeric type is promoted.
Different technologies place this logic in different layers. Self-describing file formats such as Avro and Parquet store the schema alongside the data, so each file carries its own structure. Table formats such as Delta Lake, Apache Iceberg and Apache Hudi keep a schema history in table metadata, which allows a query engine to read files written under many schema versions as one logical table. Schema registries do the same for streaming systems by assigning each schema an identifier that travels with every message.
Apache Iceberg illustrates a robust mechanism: it tracks columns by unique field IDs rather than names or positions. A rename therefore changes only metadata, and a dropped column cannot be accidentally resurrected when a new column with the same name is added later. Formats that match columns by position or by name are more fragile, because a reorder or a rename can silently map data to the wrong column.
Compatibility modes and change types
Compatibility describes which side of the exchange can be upgraded first without failures. A change is backward compatible when new readers can read old data, and forward compatible when old readers can read new data. Full compatibility requires both, which is the safest setting when producers and consumers deploy independently.
| Mode | Guarantee | Upgrade order |
|---|---|---|
| Backward | New schema reads data written with the previous schema | Consumers first, then producers |
| Forward | Previous schema reads data written with the new schema | Producers first, then consumers |
| Full | Both directions hold for adjacent versions | Any order |
| Transitive variants | Guarantee holds against all earlier versions, not only the last | Any order, long retention |
| None | No checks are performed | Coordinated big-bang release |
Individual changes fall into predictable classes. The following table summarizes the typical safety of common changes under Avro-style resolution rules; exact behavior differs by format and engine, so each platform’s documentation remains the authority.
| Change | Backward safe | Forward safe | Notes |
|---|---|---|---|
| Add optional field with default | Yes | Yes | The safest additive change |
| Add required field without default | No | Yes | Old records lack a value |
| Remove field that has a default | Yes | Yes | Old readers fall back to the default |
| Remove required field | Yes | No | Old readers expect the value |
| Widen int to long | Yes | No | Narrowing is never safe |
| Rename field | Only with aliases | Only with aliases | Iceberg handles it by field ID |
| Change field meaning, same type | Technically yes | Technically yes | Semantic break no tool detects |
The last row highlights a crucial point: structural compatibility does not guarantee semantic compatibility. Changing a price column from gross to net amounts passes every automated check and still corrupts downstream reports.
Schema evolution across storage and streaming formats
Support for schema evolution varies widely between formats, and the choice of format often decides how painful future changes will be. Row formats designed for messaging emphasize compatibility rules, while columnar and table formats emphasize metadata-level operations on very large datasets.
| Format | Schema location | Evolution strengths | Typical weakness |
|---|---|---|---|
| Avro | Embedded or registry | Rich resolution rules, defaults, aliases | Requires discipline with defaults |
| Protocol Buffers | Compiled definitions | Numbered fields tolerate additions | Reusing field numbers corrupts data |
| Parquet | File footer | Engines merge compatible file schemas | Renames and type changes are limited |
| JSON | None by default | Flexible, no enforcement | Drift goes undetected without validation |
| Apache Iceberg | Table metadata | Add, drop, rename, reorder, widen by field ID | Requires a catalog and compatible engines |
| Delta Lake | Transaction log | Additive merge, optional column mapping | Some changes require table rewrites |
Relational data warehouse platforms handle evolution through DDL statements such as ALTER TABLE. Adding a nullable column is usually a fast metadata operation, while changing a type may trigger a full rewrite. Change data capture pipelines add another layer of difficulty, because DDL in the source database must be detected and propagated to every downstream target in the correct order.
Managing schema changes in production pipelines
Mature teams treat schema changes as versioned, reviewed releases rather than side effects of code changes. The schema becomes an explicit artifact, often formalized in a data contract that names the owner, the compatibility mode and the deprecation policy for each field.
The safest general technique for breaking changes is the expand and contract pattern. The producer first adds the new field alongside the old one, consumers migrate to the new field, and only after all consumers have moved is the old field removed. This turns one breaking change into a sequence of compatible ones.
| Situation | Recommended approach | Reason |
|---|---|---|
| New optional attribute | Add field with a default | Fully compatible, no coordination |
| Field must be renamed | Expand and contract or alias | Avoids breaking existing readers |
| Type must narrow or change | New field plus backfill | Narrowing loses data silently |
| Meaning of a field changes | New field with a new name | Prevents silent semantic errors |
| Large historical rewrite needed | Versioned new table and migration | Isolates risk and allows rollback |
- Enforce compatibility in CI by testing proposed schemas against the registry before deployment.
- Use automatic schema merging selectively, because unrestricted merging lets typos create permanent new columns.
- Log and alert on schema drift in ingestion jobs that read loosely typed sources.
- Document deprecations with dates so consumers can plan migrations.
Limitations and common mistakes
Schema evolution reduces breakage but cannot make every change free. Some operations, such as splitting one column into two or changing a primary key, require data backfills or full table rewrites, which consume compute and may lock or duplicate storage for hours on very large tables.
Frequent errors include adding required fields without defaults, reusing a retired Protocol Buffers field number, enabling automatic schema inference on raw JSON so that a single malformed record changes a column type, and assuming that a passing compatibility check means downstream dashboards are safe. In the medallion architecture, a related mistake is propagating raw-layer schema drift directly into curated layers instead of absorbing it at the boundary between bronze and silver tables.
Another limitation is tooling fragmentation. A change that Iceberg handles as a metadata update may still break a transformation in dbt, a BI semantic layer or a reverse ETL sync that maps columns by name. End-to-end evolution therefore requires lineage awareness, not only a capable storage format.
Put simply
Data has a shape, like the columns of a spreadsheet. Over time, a business needs to add a column, rename one or store a bigger number. Schema evolution is the set of rules that lets the shape change without making older files unreadable or breaking the programs that use them.
Think of it like adding a new line to a paper form. Old forms without that line are still valid, and staff simply treat the empty line as blank. The key idea is to change data structures in small, compatible steps so nobody is surprised.
In practice
An online retailer streams order events through Apache Kafka with Avro schemas stored in a schema registry set to full transitive compatibility. The analytics team needs a new delivery_window field, and the payments team wants to replace an integer amount_cents field with a decimal amount field that also carries currency.
The delivery_window field is added as optional with a null default, passes the registry check and ships the same day. The amount change follows expand and contract: producers write both fields for six weeks, the data lake ingestion job and three dbt models switch to the new field, and the Iceberg order table gains the decimal column through a metadata-only update. Once lineage shows no remaining readers of amount_cents, the old field is dropped. The migration completes with zero failed consumers and no historical backfill, because older records still resolve through their original schema version.