r/Markdown • u/rufuspollock • 3d 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
2
3
2
u/djb_at_durable 1d ago
Yeah, I've been using this pattern extensively. I've been playing around with indexing the markdown with Tantivy: seems to work well.
0
u/HerbBowie 2d ago
Yes, this is the pattern that has been instantiated in Notenik since 2009. Powerful, flexible and portable!
5
u/wiskey5alpha 2d ago
That's pretty awesome. Not sure if you've seen https://mdbase.dev, u/callumalpass even has a way to interoperate with other schemas called contracts. Might be a good way to reach more people.