# Schema on Write and on Read

> Two moments to check the shape of data. Schema on write checks it as data is saved, schema on read checks it at query time. Then what changes break.

**Course:** [Data Engineering Basics](https://learn.benibix.com/learn/data-foundations)  
**Time:** 11 min

**After this lesson you can:**

- Explain when each approach checks the shape
- Say which approach a warehouse and a lake use
- Change a schema without breaking its readers

## When the shape of data gets checked

A schema is the agreed shape of data: its fields, their types and their rules. There are two moments to check it. Schema on write checks the shape when data is saved, and refuses rows that do not fit. Schema on read saves anything and applies the shape later, at the moment someone runs a query.

Schema on write is how a database and a warehouse work. You declare the table first, with every column and its type. A row with a word where a number should be is turned away at the door. Bad data never lands, so every reader can trust what is there.

The cost is speed of change. A new field in the source means changing the table before the data can load. Until someone does, the new field is dropped or the load fails. A team with fifty sources can spend a lot of its week on this.

Schema on read is how a data lake works. Files land as they are, JSON, CSV or logs, with no check at all. The shape is applied by the query engine at the moment someone reads the files. Landing is fast, and nothing is lost, even fields nobody planned for.

The cost moves to the reader. Every query has to cope with missing fields, odd types and broken rows. Ten analysts may handle the same mess in ten slightly different ways. The data is all there, but each person has to clean it again before they can trust it.

Either way, schemas change over time. That is called schema evolution. Adding a column is most often safe, because old readers just skip it. Renaming or removing a column is the risky kind. Every report that asked for the old name breaks the next day. Add new columns freely, and take old ones away slowly.

People often think schema on read means no schema at all. There is always a schema. The only question is who writes it down, and when. With schema on read, every reader writes it, every time, unless someone writes it once for all of them.

## Which one to pick

1. **Schema on write.** Pick it for data that many people report on, such as orders. There, a wrong value costs money.
2. **Schema on read.** Pick it for raw data you are still looking through. It also suits sources that change shape often, such as app logs.

![Two rows of four boxes. Schema on write: new rows pass a highlighted check on the shape as data is saved, where a bad row is turned away, then go into a warehouse table holding only rows that fit, which readers trust. Schema on read: new files land in a data lake where everything lands, and the highlighted shape check happens inside each query, so every reader copes with bad rows.](https://learn.benibix.com/diagrams/dfd-schema-write-read.svg)

### Example: An app adds a new field

Jack's app starts sending a new field in its events, the kind of phone. The warehouse table has no such column. So the nightly load fails, and the morning report is empty.

His team now lands raw events in the lake first and adds new columns to the warehouse table each week. Nothing is lost while the table catches up.

**Words in this lesson:** [Schema-on-Write](https://learn.benibix.com/term/data/schema-on-write), [Schema-on-Read](https://learn.benibix.com/term/data/schema-on-read), [Schema Evolution](https://learn.benibix.com/term/data/schema-evolution)

> **The one thing to remember.** Schema on write checks the shape at the door and keeps bad rows out. Schema on read lets everything in and makes every reader do the check.

**Question:** A team renames the column total to amount. What usually happens next?

**Answer:** Every report that asks for total breaks. Readers ask for a column by its name. A rename is a breaking change, so add the new column first and retire the old one slowly.

---

Source: https://learn.benibix.com/learn/data-foundations/schema-on-write-and-schema-on-read
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-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
