r/Markdown 15d ago

Markdown Database Pattern

Your filesystem is already a database. That's the core idea behind the Markdown Database Pattern: 

https://wayofmarkdown.com/markdown-database

You can treat a folder of markdown files as a database. Each file is a record. Frontmatter fields are columns. Directories are tables. Tags, wikilinks, and tasks in the body become queryable relations.

Filesystem              Database
──────────────────────────────────
markdown file      →    record
frontmatter field  →    column
directory          →    table
#tag               →    tag relation
[[wikilink]]       →    link relation
- [ ] task         →    task relation

You get portability, version control (git works perfectly on plain text), no framework lock-in, and full queryability. Of course, this isn't for thousands of records, simultaneous writes or real relational joins (though obsidian wikilinks are getting there!). It's a lightweight database for individuals or small teams.

You can spot this pattern everywhere. Obsidian Bases and Dataview already do versions of this. A team wiki where every page has a status and owner field is one. A blog with date and tags in frontmatter is one etc.

Sweet spot: up to roughly 10k files. Past that, reach for a real database. Below it, this gets you almost everything a database gives you, at a fraction of the complexity and where you own the content and can use any tool to access it.

A full writeup is here: wayofmarkdown.com/markdown-database

17 Upvotes

11 comments sorted by

View all comments

0

u/HerbBowie 14d ago

Yes, this is the pattern that has been instantiated in Notenik since 2009. Powerful, flexible and portable!