Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB: disk_size vs data_size

Tags:

couchdb

What's the difference between disk_size and data_size in http://registry.npmjs.org/.

I suppose disk_size is the size taken by the database on the disk and data_size is the size of the actual data.

But what does the diff contain exactly? CouchDB views? Unused sections created during updates? ...?

like image 686
benweet Avatar asked Nov 26 '25 20:11

benweet


1 Answers

From CouchDB docs:

  • data_size (number) – Actual data size in bytes of the database data.
  • disk_size (number) – Size in bytes of the data as stored on the disk. Views indexes are not included in the calculation.

The difference between them is filled by old documents revisions and also may be called as database fragmentation. When it gets high enough it's worth run database compaction to free some disk space. After database compaction all non conflicted revisions becomes removed and these values becomes more-less equal.

like image 68
Kxepal Avatar answered Nov 28 '25 16:11

Kxepal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!