layman/terms
Inside an app

Schema

skee · muh

In shortThe agreed layout for information: which fields exist, what type each one is and which are required.

A paper form decides what you can write and where. A schema does that for a database.

A paper form has a fixed layout: a box for your name, one for your date of birth, tick-boxes for yes or no. Some boxes are required. You can’t write your shoe size in the phone number box.

A schema is that layout for data. It’s the agreed set of rules about what information is stored, what type each piece is and which pieces are required.

What a schema says

Why it matters

It keeps data tidy and predictable. Every part of an app can rely on an email always being an email. A date is always a date.

What it isn’t

It isn’t the data itself. The schema is the empty form. The data is all the filled-in copies.

Where the comparison breaks down

You can reprint a paper form any time. Changing a schema when millions of records already exist is careful work, called a migration.

How the words fit together

A database follows a schema. APIs often publish theirs too, so other apps know what to send. Data often travels as JSON.

Watch out

Changing a schema on a live product needs care. Old data must still fit the new shape, or things break.

When you'll hear it

“We need a schema change.” We need to add or change a field in the database's agreed layout.

“That field isn't in the schema.” The database has no place to store that piece of information yet.

“It failed schema validation.” The data didn't match the agreed layout, so it was rejected.

Say it in a meeting

“If we start collecting a new piece of information, where does it fit in our current data layout?”