# Schema-on-Read

> Store data as it comes. The shape is set later, when it is read.

**Field:** Data Engineering  
**Category:** Foundations  
**Also known as:** Schema on Read

## Think of it like

It is like a big box you throw toys into. You sort them only when you want to play.

## Definition

Schema-on-read means data is stored as it comes, with no shape forced on it. The shape is applied later, by the query that reads it. Each reader can pick the fields it needs and how to treat them. This makes loading fast and easy. The cost is that bad data is only found when someone reads it.

## Example

A team dumps raw JSON logs into a data lake each day. Months later, an analyst reads just the city field from them.

## Example code

```sql
SELECT doc->>'city' AS city, COUNT(*)
FROM raw_events
GROUP BY 1;
```

The query picks the city field out of raw JSON at read time.

## Why it matters

You can keep data before you know what you will ask of it. New questions do not need a reload.

## Common mistake

Thinking it means no schema. The schema still exists. It just moves into every query.

## Three principles

- **Load as is.** No shape is forced on the way in.
- **Shape at query time.** The reader picks fields and types.
- **Errors show late.** Bad data is found on read.

## Related terms

- [Schema-on-Write](https://learn.benibix.com/term/data/schema-on-write)
- [Semi-Structured Data](https://learn.benibix.com/term/data/semi-structured-data)
- [Database Schema](https://learn.benibix.com/term/development/schema)
- [Extract, Load, Transform (ELT)](https://learn.benibix.com/term/data/elt)

## Told apart from

- [Schema-on-Write vs Schema-on-Read](https://learn.benibix.com/compare/schema-on-write-vs-schema-on-read): People think schema-on-read means data with no schema. Both have a schema. Schema-on-write checks each row against the shape when it is stored. Schema-on-read stores data as it comes and applies the shape in each query. The first catches bad data early. The second lets you load first and ask later.

## 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

---

Source: https://learn.benibix.com/term/data/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-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
