File Storage is the practice of storing main (primary) site content in flat files in a filesystem.
- 1 Why
- 2 How
- 3 IndieWeb Examples
- 4 Other Independent Examples
- 5 Intranet Examples
- 6 Flat file "CMS" systems in the wild
- 7 Software
- 8 Criticism
- 9 See Also
Many indieweb projects are storing their data in flat files on the file system for reasons of simplicity and robustness.
See also the databases-antipattern for reasons why flat files for storage are growing in popularity compared to databases.
These flat files typically are either:
- Markdown with custom (per project) extensions for various metadata
- HTML+microformats (e.g. hAtom and/or h-entry)
And contain either:
- one post per flat file
- time sharded: a set of posts per fixed time period per flat file
IndieWeb community members that use file storage on their personal site.
Tantek Çelik on tantek.com uses flat files for primary storage of content:
- 2010-01-01... present: Falcon which stores data in HTML+microformats flat files, 6 per year (1 per bim). See Falcon storage format for details.
- 2002-08...2008-08 static site directly served from primary storage of flat files, up to 12 per year (1 per Gregorian month).
- posts - since 2003-12-18 stored as text with some textual/markdown/whatever markup, with one file per post, named year+day-of-year, key:value header for metadata and a json blob for connected resources
- webmentions - stored as html in the same directory as the post
- comments - stored as html in the same directory as the post
- feeds and related
Bret Comnes uses the following on bret.io:
- Stores site content in git
- Renders to html using jekyll/gh-pages
Yaml headers (aka front-matter) with GitHub flavored Markdown mixed with liquid template include tags for post attachment metadata. Yuuuuuck! This is what jekyll sets you up with. It has its ups and downs, but its a mix of 3 weird languages which really bothers me.
- notes and articles as YAML files with HTML in (wants to change these to HTML+mf2 for browsability, standards support)
- timestamped HTML archives (along with HTTP headers in *-headers.txt) in URL-mimicking folder structures
- Sheet music in ABC files
- Simple, working Editor saves simple articles as html files to the filesystem.
- Viewer system loads the html files and can output them with different markup, css, adding h-data, etc.
- Wants to save html files with microdata schema for super cool idea that I have
- Notes are stored as html+mf2 and JSON files, with a copy in the database (only create and update currently). Posts are currently generated from the database (to be changed soon...).
- Articles content is stored as Django templates wit meta-data in database.
Dmitri Shuralyov uses filesystem-backed implementations of services to store all dynamic content of https://dmitri.shuralyov.com. It feels cleaner, simpler, more lightweight than pulling in a heavy database dependency, and sufficient for current needs.
Specifically, blog posts (and their comments), issues (within issue trackers), events, notifications, reactions and users are stored and modified as flat files on disk. The functionality is implemented in various Go packages named
... add yourself ...
... many more Jekyll users
... many more Hugo users
Want to use file storage
IndieWeb members that *want* to use File Storage on their personal site:
- add yourself.
Other Independent Examples
David Baron on http://dbaron.org/ uses flat HTML files, one per blog post, one for his blog index page, since 2002.
- Our Slack Wiki: No Database, https://medium.com/why-not/our-slack-wiki-e4f6d23a3495#3aad :
Flat file "CMS" systems in the wild
- Grav is a PHP, YAML, Twig and Markdown Extra based storage project which looks promising.
Command Line Configuration
The process of uploading and setting up flat file storage on shared hosting may require command line configuration such as:
- chmod -R 0777
Any flat file storage solution should seek to minimize and eliminate any command line based configuration needs.