Question

I understand that CouchDB views are pre-computed, now I'm wondering what the storage cost is per view. How can this be estimated? Is it the raw JSON size of the emitted data?

To be more specific, it's BigCouch (Cloudant).

Was it helpful?

Solution

I can't give you a rule for estimation, but you have to consider several factors here

  • CouchDB uses append-only storage, so your database (and view) files will grow also if you update data. To free unused space again, compaction is needed.
  • The data vs on-disk sizes can be extracted using the _info endpoint of a design-document
  • CouchDB uses a B-tree data structure for indexing, so a view requires the space of serialized JSON + some overhead for the tree
  • Since version 1.2 CouchDB by default compresses the database and view files with the snappy algorithm
  • If you are interested in the internals, there are discussions here, here, here and here.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top