Is there a way to limit the number of revisions in couchdb? Something along the lines of a hard limit in a config file. I am aware of the fact that I could periodically compact the database, but somehow it feels like a hack. Is there a better way?
+1
A:
There's no configurable limit, primarily because CouchDB uses append-only storage, i.e. it promises to only ever write to the end of a file and never change anything in the middle. As a result a configurable limit is meaningless.
Compaction is your only option. There has been some talk about automatically triggered compaction on the mailing lists but it can only be triggered manually for now.
Matt Goodall
2010-01-21 13:31:32
Ok, I see, thanks!
Anvar
2010-01-21 14:29:14
Actually, there *is* a per-database revs per document limit. The default is 1000 but it can be changed by PUT'ing an integer to the database's _revs_limit resource, e.g. "curl http://localhost:5984/test/_revs_limit -X PUT -d 50".You'll still need to compact to get the disk space back so it doesn't really change my previous answer as far as the question is concerned, you'll just get a bit more disk space back with a lower _revs_limit.I don't know how much space it really saves, and a low _revs_limit may affect replication.
Matt Goodall
2010-01-26 23:03:01