Ask HN: How to version control DB data?
Fyi, I have posted to SO, with little satisfaction: http://stackoverflow.com/questions/8522766/what-are-the-standard-recommended-ways-to-store-version-controlled-database-dat
Fyi, I have posted to SO, with little satisfaction: http://stackoverflow.com/questions/8522766/what-are-the-standard-recommended-ways-to-store-version-controlled-database-dat
At a high level, you could just keep a record of every version of every blog post, then separately maintain which entry is most current, or active, or whatever metric you want to display/query. This will let you maintain all versions of the blog post and you can run diffs on different versions, revert to older versions and branch from any version.
1. Insert the new row
2. Find the previous row
3. Set previous row to `active`=0
Are there performance tricks to keep this reasonable? I'd also wonder how to modify the table itself (dropping/adding columns) when there would potentially be selects + inserts + updates running 100% of the time - but I realize that's borderline out of scope of the OP's question.
I'd re-examine your requirements on this one. You normally wouldn't be doing intense revision control directly inside of the database