# Schema Evolution

> Changing the shape of data over time. Code that reads it must keep working.

**Field:** Data Engineering  
**Category:** Foundations  
**Also known as:** Schema Versioning

## Think of it like

It is like adding a new box to a paper form. Old forms still work, and they just leave it blank.

## Definition

Schema evolution is changing the shape of data over time without breaking what reads it. A schema is the list of fields and their types. Adding a new field is usually safe, because old rows can leave it empty. Renaming or deleting a field can break every report that uses it. Good systems check each change before it goes live.

## Example

An orders table gets a new coupon field. Old orders show it as empty. Reports that never used it keep working.

## Example code

```sql
ALTER TABLE orders ADD COLUMN coupon_code TEXT;
```

A safe change: one new field, empty for all the old rows.

## Why it matters

Data changes because the business changes. One renamed field can break many reports in one night.

## Common mistake

Renaming a field in place. Add the new name, move the readers over, then drop the old name later.

## Three principles

- **Add, do not rename.** New fields are safe. Renames break readers.
- **Old rows still read.** Old data must still load the right way.
- **Check first.** Test each change before it ships.

## Related terms

- [Database Schema](https://learn.benibix.com/term/development/schema)
- [Schema Drift](https://learn.benibix.com/term/data/schema-drift)
- [Schema Registry](https://learn.benibix.com/term/data/schema-registry)
- [Apache Avro](https://learn.benibix.com/term/data/apache-avro)
- [Database Migration](https://learn.benibix.com/term/development/database-migration)
- [Schema-on-Write](https://learn.benibix.com/term/data/schema-on-write)

## Told apart from

- [Schema Evolution vs Schema Drift](https://learn.benibix.com/compare/schema-evolution-vs-schema-drift): People think schema drift and schema evolution are the same change. Evolution is planned: a team adds a field on purpose and checks that readers still work. Drift is a surprise: a source changes its shape and nobody downstream was told. The first is a habit to build. The second is a problem to catch.

## Taught in

- [Schema on Write and on Read](https://learn.benibix.com/learn/data-foundations/schema-on-write-and-schema-on-read): Data Engineering Basics, 10/11

![Version 1 of a table has columns id and total, with two rows. An arrow leads to version 2, which adds a highlighted coupon column: the two old rows say empty and a new third row says SPRING. Beside them, a dashed box marked risky shows total renamed to amount, so every report that asks for total now fails.](https://learn.benibix.com/diagrams/dat-schema-evolution.svg)

---

Source: https://learn.benibix.com/term/data/schema-evolution
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
