Schema

A schema describes the expected structure of data. For records, this commonly includes field names, data types, and rules such as which fields are required. Depending on the system, it can also express relationships or constraints. Here schema means data structure; some databases also use the word for a namespace that groups objects.

Structure is not the same as meaning

An order record might require an order identifier as text, an amount as a number, and a currency code as text. In JSON Schema, describing a property and marking it as required are separate choices. A field can have a declared type yet still be optional.

Suppose the amount is 500. The record may pass a structural check while leaving a crucial question unresolved: is that 500 dollars or 500 cents? Types alone do not define units, accounting rules, or what one row represents. Those meanings need documentation or additional enforceable rules.

When a schema changes

Changing amount from a number to text can break a calculation. Adding an optional field may be compatible with one reader but rejected by another that forbids unknown fields. Compatibility depends on both the change and the consumer’s rules.

An undocumented structural change is often called schema drift. Validating schemas can expose it, but structural validation will not catch every change in business meaning. A field called revenue can keep its name and type while its definition changes.

Reference: JSON Schema: Creating your first schema.


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.