The practical reference for enforcing JSON Schema contracts in MongoDB, migrating them with zero downtime, and turning validation into audit-ready evidence.
🌐 Read it live at schemavalidation.org
schemavalidation.org is a free, in-depth knowledge base for MongoDB developers, data engineers, Python automation builders, and platform teams who need to run schema validation in production — not just define it once and hope.
Every page is grounded in real $jsonSchema syntax, runnable PyMongo and mongosh code, exact error signatures (WriteError code 121, errInfo.details.schemaRulesNotSatisfied), and hand-drawn architecture diagrams. No pseudo-code, no filler — 56 guides and ~180,000 words of operational detail, all interlinked so you're never more than a click or two from the answer you need.
Most teams treat schema validation as an afterthought: a validator gets attached to a collection, then drifts silently out of sync with the application until a downstream analytics job breaks weeks later. This site makes the case — and shows the mechanics — for moving schema governance out of brittle application code and into durable, version-controlled, database-level infrastructure you can deploy, test, and roll back like any other code.
The material is organised into four tracks:
- Validation Architecture — the enforcement contract itself:
$jsonSchemasyntax and BSON-to-JSON type mapping, strict vs. moderate levels, versioning strategies, security boundaries, cross-collection consistency, and fallback routing for invalid documents. - Enforcement & Monitoring — the operational automation: collection-level validators, PyMongo integration, error categorization, fallback validation chains, and async monitoring dashboards with Atlas alerting.
- Migration Automation — evolving schemas on live traffic without an outage: batched document transformation pipelines, index rebuild ordering, online dual-write cutovers, and one-command rollback automation.
- Compliance & Audit — validation as a control: GDPR field-level encryption interplay, immutable audit-log schema contracts, and generating SOC 2 evidence from validation telemetry.
- Backend and data engineers shipping MongoDB-backed services who want type-safe, non-bypassable data contracts.
- Platform teams rolling out schema governance across many collections and clusters through CI/CD.
- Python automation builders wiring PyMongo/Motor validation into ingestion and migration jobs.
- Anyone debugging a code 121, planning a zero-downtime migration, or assembling audit evidence.
- ✅ Runnable Python (PyMongo / Motor /
jsonschema) andmongoshcode on every page - ✅ Original, accessible inline-SVG diagrams for the hardest concepts
- ✅ Exact diagnostic fingerprints — error codes, log ids, driver exception paths
- ✅ Structured data (Article, BreadcrumbList, HowTo, FAQ) on every guide
- ✅ Fast, installable Progressive Web App that works offline
A fully static site generated with Eleventy (11ty), authored in Markdown with Nunjucks templates, and deployed to Cloudflare. It ships as an installable PWA with a service worker for offline reading, self-hosted assets, and no third-party trackers.
npm install # install dependencies
npm run build # generate the static site into _site/
npm start # local preview with live reloadThe content is published for the MongoDB community to learn from and reference. Please link back to schemavalidation.org rather than republishing pages wholesale.