Data Schema
AI Engineer path · lesson 66 of 124Validate a record live, see the same schema in SQL, JSON Schema, Pydantic, and Protobuf, walk a backward-compatible migration, and use the schema to constrain an LLM's structured output.
Key insight
A schema is the data contract — each field’s type and constraints. Enter a bad value and validation rejects it on the spot. This is the same machinery that makes an LLM’s structured output trustworthy.
Fact or dimension?
Sort each table into its place in a star schema.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Fact table
Drop items hereDimension table
Drop items hereTest your knowledge
What does a schema constraint like CHECK (age >= 0) provide?
The short version
A schema is the blank form with rules printed on it: this box takes a number, this one a valid email, this one only "admin/user/guest". Fill it wrong and it's rejected at the door.
In more depth
Data Schema
A schema declares the shape of data — field names, types, and constraints (required, ranges, enums, formats). It's the contract every producer and consumer agrees on, expressible as SQL DDL, JSON Schema, Protobuf, or a Pydantic model.
Schema-on-write validates before storing (strong, rigid); schema-on-read validates at query time (flexible, late errors). In AI systems, a schema is also what lets an LLM emit structured outputs and tool arguments the rest of the pipeline can trust.
Interview Questions
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required