Kelly Mears

Schema Drift

Divergence between a schema and the code, types, or documentation that describe it.

Data & Content2 min read214 words12 out · 14 in
also calledType driftGenerated types

Schema drift is the gap that opens between a data model and everything else that claims to describe it: generated types, validation rules, documentation, tooling, and the assumptions embedded in code.

The reliable defense is generation plus verification. Types derived from the schema cannot drift by construction, and a build step that regenerates them and fails on any difference converts drift into a red build rather than a runtime surprise. Worth knowing: such a check can be triggered by changes that seem purely cosmetic, since documentation text on a field is frequently emitted into the generated output.

Drift also travels along the type graph in ways a diff cannot show. Relaxing a required field to optional widens its generated type, which breaks every reader in the codebase — including readers written after the change was started, which appear in neither the conflict list nor the change's own diff. The type checker, not the merge, is the detector. See Semantic Conflict.

A related asymmetry causes real bugs: a system may advertise a richer schema through its introspection surface than its write path actually accepts. Readers then learn about fields that writes reject. Keeping the two in lockstep — ideally with a test asserting the read model equals the write model — is what closes it.

See also11

Schema Validation

Checking data against a declared shape at runtime, and using the result as the typed value.

Agents & Language Models22 connections

Deprecation

Marking something as superseded and scheduled for removal, without removing it yet.

Method20 connections

Client-Server Boundary

The line in an application where execution moves from the server to the browser.

Web Platform11 connections

Tool Use

Giving a model a set of callable functions so it can act on the world rather than only describe it.

Agents & Language Models27 connections

Relational Database

Data organized as tables with declared relationships, queried declaratively and guarded by constraints.

Data & Content21 connections

Documentation Rot

Documentation that has drifted from the system it describes, and is now worse than none.

Method28 connections

Database Migration

A versioned, ordered change to a database schema, applied once and recorded.

Data & Content20 connections

Technical Debt

The future cost of a present shortcut, metaphorically accruing interest.

Method31 connections

Object-Relational Mapping

A library that lets code treat database rows as ordinary objects, saving a great deal of boilerplate at the cost of hiding the queries that actually run.

Data & Content9 connections

ETL Pipeline

The job of pulling data out of operational systems, cleaning and reshaping it, and loading it somewhere it can be analyzed, and the move from transforming before loading to transforming after.

Data & Content9 connections

Schema Evolution

Changing the shape of stored or transmitted data without breaking the old readers and writers that still expect the previous shape.

Data & Content9 connections

Linked from14