I will soon be beginning work on a project that (from the spec) reminds me a bit of StackOverflow. Basically, its a web app that has user-controlled content.
One of the features that's got me going around in circles in my mind is the version control. Here on StackOverflow, each question and answer can have multiple revisions. This is pretty simple to implement when you have only one type of object (and, in this case, its text).
So, for my simple pages, I'm set.
The problem comes in when I consider that some objects that need to be under version control have relationships. To provide a concrete example, let me choose a random analagous domain:
Lets say I was implementing a Wiki-like site for keeping track of book/author info. The primary focus of the site would be to create and update "Author" pages, which, as text, is pretty simple (as above). However, let us add a one-to-many association between authors and books (in other words, books would be separate objects, as obviously a person could author many books). Each book would have a link from the Author page to an informational page about that book.
To the user, there is little difference between the text-based "summary" describing the author and the links between that author & their works. Thus, we have a requirement to implement the "revision"/edit feature for author pages, book pages, and the association between authors and books. In other words, the user should be able to edit, view history of, and rollback author pages, book pages, and associations between the two.
This becomes even more complicated when that relationship becomes a many-to-many, where multiple authors could be listed as having contributed to a book.
I have a number of solutions in mind, but none of them are as clean as I'd like (and involve at least some repeated code/redundant data storage), and, although I do see commonality all over the place here, I feel that I haven't really been able to extract it best, especially at the database level. I don't want to bias the answers given so I'm not going to give them right away.
So, how would you design this system at the database level? I'm looking for table specifications here, and possibly a description of how you'd use them, if its not immediately obvious. For those answers to which it may be relevant, I'm going to be using ASP.NET and either Linq-to-SQL (I'm comfortable with many-to-many in LTS) or Entity Framework.
EDIT: To clarify, I understand basic DB design, normalization, many-to-many mapping tables, etc. I'm looking for a clean solution to this specific situation.
EDIT 2: I'm looking for a generalizable solution, as there may be way more sub-objects in the system than just books. The author may be related to other authors, magazines, events, etc, etc, etc. I feel like I'm repeating a lot of work if I implement history individually for each one.