Revisions: algorithm and data structure
Posted
by SODA
on Stack Overflow
See other posts from Stack Overflow
or by SODA
Published on 2010-04-15T04:23:15Z
Indexed on
2010/04/15
5:23 UTC
Read the original article
Hit count: 258
Hi, I need ideas for structuring and processing data with revisions. For example, I have a database of objects (e.g. cars). Each object has a number of properties, which can be arbitrary, so there's no a set schema to describe these objects. These objects are probably saved as key-value pairs.
Now I need to change property of an object. I don't want to completely rewrite it - I want to be able to go back and see history of changes to these properties, that's why I want to add new property and keep the old one (so I guess a timestamp would do the job of telling which property is the latest).
At the same time I want to be able to get info about any object in a snap, with only latest versions of each of the properties.
Any ideas what would be the best approach? At least please point me in the right direction. Thanks!
© Stack Overflow or respective owner