首页 > Linux操作系统 > Linux操作系统 > Reducing CouchDB disk space consumption

Reducing CouchDB disk space consumption

原创 Linux操作系统 作者:jieforest 时间:2012-07-13 10:58:10 0 删除 编辑
Apache CouchDB offers high availability, excellent throughput and scalability. These goals were achieved using immutable data structures – but they have a price: disk space. CouchDB was designed under the assumption that disk space is cheap. Though it is indeed getting cheaper and cheaper, it is not infinite. Here’s a tip to reduce CouchDB database files’ disk consumption.

When a CouchDB document is updated, the new version gets a new revision number, while the old one stays in the database. To get rid of those old revisions, database compaction can be used:


curl -H "Content-Type: application/json" -X POST http://localhost:5984/testdb/_compactThis call removes all revisions except the most recent one from the database. With CouchDB 1.2, it is also possible to configure automatic compaction.
However, there is more that can be done. Here is a table showing the increase in size of a CouchDB database file when adding a single revision of a document (100 byte raw data), depending on the revision:


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量