I'm looking for a way to use CouchDB or BigCouch (or another "compatible" DB) in such a way that all revision history can be maintained or at least archived. I know that CouchDB internally does this anyway, and only deletes old revisions upon compaction. Since CouchDB/BigCouch are open source, I would imagine it would be possible to hack something together to enable this feature. For example, copying every revision to an archive DB before the compaction process deletes them.
As an aside: I worked at a couple companies that wanted an "audit history" of their SQL DB, and we implemented this by creating an "audit table" and we wrote triggers that inserted records into this table upon any other table being modified.
Can someone with more knowledge of CouchDB tell me how this could be done? I'm curious if anyone has done it before. It seems like it would be a very useful feature, so if hasn't been done before, I wonder why?
NOTE: this question is partially inspired by Dataomic, a DB that has the desired properties. So I'm looking for basically is an open-source, perhaps more lightweight alternative to Datomic.