Hello,
Im trying to figure out the best way to keep history/revision of tables in a relational database.
I have done some research and reading, and am not sure what would be the best way to go about keeping track of changes. For my main tables, Im quite sure I have settled for a revision table, to keep track(see picture) but it is the relation tables that Im not sure about. Maybe just an audit trail table holding the changes?
Looking at the sample picture below, what would be the best way to keep history of the "movies_has_actors" table? I cant simply do as with the two main tables(movies,actors), as I need to know which MOVIE revision_id that was the active one at the point of time the relation was made. And what if I want to throw in tracking of which USER added the relation (USER table not in sample picture) ? I dont want to keep everything in the relation table itself, becuase that will just grow huge and slow down queries...![alt text][1]
So to sum up, what is the best way to keep history, of a relation table?
regards, modano
Link to image: img115.imageshack.us/my.php?image=44623598nv1.jpg
[1]: Image