Markdown as a Database

For a personal website, a folder of Markdown files with a structured header replaces the database, as long as a schema checks it.

A drawer packed with tabbed paper folders slides out of a dark server rack, a single card lying in a slot on its front panel.

A database does three things: it stores records, enforces their shape and answers queries. A folder of Markdown files can do all three with a little help.

Storing

Every file is a record. The file name is the key, the frontmatter holds the fields and the text below it holds the content.

Enforcing shape

This is the difference between a pile of notes and a dataset. Here, kb check validates every file against a schema and the ontology, every relation included. A reference that leads nowhere is reported as an error.1 The website only reads the files and never writes them.2

Querying

For a few thousand files it is enough to read everything once and keep it in memory. This website reads the files when it starts and again within seconds when one of them changes.2 Only well beyond that does a real database pay off, and even then the files remain the source.


  1. The kb tool and its checks (saved chat). ↩

  2. The website on FastAPI (saved chat). ↩

More on this

Topic
  • Static Website A website made of finished HTML files that are built once and then served unchanged. No server code, no database.
Builds on
  • Markdown Simple markup language for text. Files stay readable without special software and can be converted to HTML.
See also
  • How an LLM Wiki Works How an LLM wiki works, shown on this knowledge base: Markdown in its own Git repository, a Python tool with MCP for agents, and a website that only displays it.

Show in the graph view →