Structured Data
YAML-LD frontmatter, schemas, templates, and database storage for MDX documents
The Structured Data layer of MDX provides semantic frontmatter using YAML-LD (YAML + Linked Data), enabling type-safe schemas, validation, and database storage.
Core Concepts
Document
The fundamental unit - combines YAML-LD frontmatter with content body.
See the Document overview.
Database
Schema-first database modeling with automatic bi-directional relationships.
See the Database overview.
Templates (Shapes)
Templates define the shape of your data - the TypeScript type or JSON Schema that structures your content:
Templates enable bi-directional conversion between objects and content formats:
See Unstructured Content for markdown layouts and UI Components for JSX rendering.
Packages
mdxld
Parse, stringify, validate, and compile MDXLD documents.
See the mdxld overview.
mdxdb
Database adapters for storing MDX documents:
- @mdxdb/fs - Filesystem (git-friendly)
- @mdxdb/sqlite - SQLite with vector search
- @mdxdb/do - Cloudflare Durable Objects (primary backend)
- @mdxdb/vectorize - Cloudflare Vectorize vector search
- @mdxdb/clickhouse - ClickHouse for analytics
See the mdxdb overview.