Skip to content
BENIBIX Learn

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.

Data🧭 Foundations

Schema-on-Write

The shape is fixed first. Data that does not fit is turned away.

Schema-on-write means the shape of the data is set before any data goes in. Each table is created with fixed columns and types. When a row is written, the database checks it against that shape. A row that does not fit is turned away. Classic databases and warehouses work this way.

Example
A bank's payments table only takes amounts as numbers. A file with "ten pounds" in that column fails to load.
Why it matters
Bad data is caught at the door. Everyone who reads the table can trust its shape.
Full entry
Data🧭 Foundations

Schema-on-Read

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

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.
Why it matters
You can keep data before you know what you will ask of it. New questions do not need a reload.
Full entry

In one line

Schema-on-Write
The shape is fixed first. Data that does not fit is turned away.
Schema-on-Read
Store data as it comes. The shape is set later, when it is read.