FYI, romdg’s post got me inspired to get this part worked out, and what I’ve come up with, revised from what I had already designed I believe will perform quite well. Let me try and break this down into concise bullet points:
- Versioning happens only to content-producing elements (i.e. templates, TV’s, chunks, snippets, plugins, etc.)
- Versions don’t apply to resources (i.e. documents, weblinks, web services, Ajax services, etc.) directly
- There are effectively four ways to define a baseline content item:
[list]
- Each element defines a default content object that has a baseline version of the content
- Elements can define context-specific content overrides (i.e. one chunk can have different content based on where it is requested from, for instance, a menu snippet might behave differently when used in the mgr context vs. the web context), which also sets a new baseline content version
- Resources can override the default content object for each element, effectively creating a new baseline version as well
- Each baseline content item can further split itself based on Culture, creating new baselines, once again
[*] From each baseline, every subsequent version of content is stored only as a diff, which can be patched back to the baseline content item up to any specific revision number
[*] A current snapshot of the content revision that is considered the HEAD revision for a piece of content (the revision which is effectively published to the site) is stored by baseline content item and culture; this is the base revision patched with all subsequent diffs up to the indicated revision number.
[*] You can define future revisions (or drafts) that are not patched into the current content snapshots until indicated
[/list]
This approach should make it very flexible and easy to work with, though there is always room for improvement.
Also, two other issues which are related to the backup vs. versioning argument:
- A dedicated table to maintain a consolidated search index, built from snapshots of rendered output from resources (i.e. documents or pages), and optionally divided by context and culture, will address optimization of search amongst a sea of normalized tables used to efficiently achieve versioning
- Defining a more robust approach to static page caching, perhaps in conjunction with the dedicated search index, based on some of the work tillda has been doing on caching HTML files, is definitely on the agenda.