开发者

CouchDB Versioning / Auditing

I'm attempting to use CouchDB for a system that requires full auditing of all data operatio开发者_如何转开发ns. Because of its built in revision-tracking, couch seemed like an ideal choice. But then I read in the O'Reilly textbook that "CouchDB does not guarantee that older versions are kept around."

I can't seem to find much more documentation on this point, or how couch deals with its revision-tracking internally. Is there any way to configure couch either on a per-database, or per-document level to keep all versions around forever? If so, how?


The revisions in CouchDB are not revisions in the way you are thinking of them. They are an artifact of the way it appends updated data to the database, and are cleaned up upon compaction. This is a common misunderstanding.

You need to implement the revision-tracking as part of the schema/document design of your application.


couch is storing all versions, but if you click in futon on "compact database" link, all previous versions will be deleted. So if notime click on compact database, all versions will be preserverd I think:)


There are two situations when the previous versions of documents in CouchDB are removed:

  1. Replication
  2. Compaction

Thus, if you do not want to store lots of data, meaning terabytes, then you probably do not need replication. Anyway, master to master replication in CouchDB is it one of the most important features. The size of CouchDB on disk is greater than a traditional database, so probably in future you will need compaction.

As aforementioned: you need to implement the revision-tracking as part of the schema/document design of your application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜