file-storage

From IndieWeb


File Storage is the practice of storing main (primary) site content in flat files in a filesystem.

Why

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.

How

These flat files typically are either:

And contain either:

  • one post per flat file
  • time sharded: a set of posts per fixed time period per flat file

IndieWeb Examples

IndieWeb community members that use file storage on their personal site.

Tantek

Tantek Çelik on tantek.com uses flat files for primary storage of content:

Aaron Parecki

Main article: p3k#Storage

Aaron Parecki on aaronparecki.com uses p3k - one file per post, YAML extensions for meta info - since ~2011. See p3k Storage details.

Kevin Marks

Kevin Marks on kevinmarks.com stores posts formatted as HTML in GitHub and deploys statically to Heroku.

Bear

Bear at https://bear.im/ uses Hakkan uses flat files for storage of all content:

  • 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 C.

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.

Rascul

rascul stores content for https://rascul.io in a git repository and uses crash.

Barnaby Walters

Stores all canonical copies of waterpigs.co.uk site data in the filesystem and uses Taproot for publishing.

  • 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

Mark87

Testing at Editor and Viewer

  • 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

Emma K.

Emma at http://notenoughneon.com using Neonblog. Posts are stored in html+mf2 files. The feed is dynamically generated from parsed microformats with an index persisted in JSON.

Kartik Prabhu

2017-05-02: Kartik Prabhu at https://kartikprabhu.com.

  • 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

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 fs.

capjamesg

capjamesg on jamesg.blog stores his posts, coffee reviews, and projects in markdown. Each markdown file makes use of YAML for metadata, such as post titles and review dates.

... 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

David Baron on http://dbaron.org/ uses flat HTML files, one per blog post, one for his blog index page, since 2002.

Intranet Examples

XOXCO

XOXCO uses flat markdown files as the storage for their internal wiki which they use and contribute to from Slack

Flat file "CMS" systems in the wild

Software

Criticism

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[1]

Any flat file storage solution should seek to minimize and eliminate any command line based configuration needs.

See Also