≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Feature request #2198

Feature request #2198: Use git as datastore

Kind feature request
Product wincent.dev
When 2015-04-07T16:53:47Z
Status open
Reporter Greg Hurrell
Tags no tags

Description

Just food for thought.

Do I anticipate using Rails forever? No.

What if I were to start versioning my content in a Git repo? In the most extreme version, the site is entirely static, generated by a static site generator. You back it up by cloning the repo. You deploy it by checking out the "build" branch (or whatever its called) on a server and pointing a webserver at the directory. You update it by pushing into the repo (requires configuration to allow pushing into a repo with a checked-out worktree; something like git config receive.denyCurrentBranch updateInstead).

Filesystem structure:

  • blog/somepost.[ext]: ext here would indicate how to process the file (could be markdown, wikitext, raw plaintext, HTML etc); open question, how to control order of the posts? (Likely need a separate index file, or use git log to figure it out, which could be slow as the repo grows.)
  • issues/10
  • wiki/Some_article

Downsides of this approach:

  • Replaces dependency on Rails with dependency on static site generator (which may end up being just a brittle/fragile due to a large dependency tree).
  • Jettisons all dynamic content (eg. no comments, no forums etc).
  • Some forms of content (eg. issues) probably not well suited to this model.

Intermediate approach: keep the app, but reduce its surface area. Instead of reading from database, we read using Git operations. We can still read things like comments from the database. Upsides: still dynamic, still get versioning features "for free". Downsides: still tied to Rails (although if app is small enough, porting to alternatives will be much easier too).

There's an overarching philosophical question here about where data should live. For a long time I tended to centralize my data towards my website, but some communities have an irresistible gravity due to network effects; for example, I mirror my stuff on GitHub, but for many people GitHub is the authoritative place, so I end up having discussions about projects in two places. Should I just move those kinds of things wholesale and stop trying to centralize? Do I try to replace dynamic elements such as comments by embedding a widget (eg. FB etc)?

See also

  • issue #1202: version wiki articles
  • issue #1935: version snippets

Comments

    Add a comment

    Comments are now closed for this issue.

    • contact
    • legal

    Menu

    • Blog
    • Wiki
    • Issues
    • Snippets