in reply to Version Control in Database Applications
For most content management problems like this, I think the multi-part key (id + version #) is the best way to go. You just keep a VERSIONS table which stores the current version number for each versioned table. You can even make this work for relationship tables if you choose a side that the relationship is from, e.g. you link foo (version 19) to bar (latest). If you put version numbers on both sides of the link and then one of the objects gets reverted, you can't easilly resolve it.
In order to make this easier to deal with from a progrmming perspective, I would suggest wrapping a database view around it. Then you can have simple keys in your queries and the view will join against the VERSIONS table and show the right one.
|
---|