Articles in this section

Can we get the size of a bin in a record?

Detail

Normally, we can see the total amount of memory or device size used by a set but is it possible to get the bin size or record size of a record?

Answer

Aerospike stores records - each record can have set name as a tag or metadata, and it can store bins. Schema is at record level and it will be whatever the user creates on a per record basis. So estimating "size of a bin in a set" could result in a very general estimation. For example, in namespace n1, in set s1, I can add two records r1 and r2. r1 can have bins b1 and c1 and r2 can have bins b2 and c2. b1, c1, b2, c2 can be completely different datatypes from each other. Now, practically speaking, in a given set, a user will follow some kind of schema across all records.

You can calculate the size of any record, including overhead, based on the data you are storing. See this link for details: https://docs.aerospike.com/docs/operations/plan/capacity/index.html but directly getting "size of a bin in a set" from Aerospike is not possible.


Notes

  • Using some client APIs, for example: On the Value class in the Java API is a method estimateSize(). This can be used to give the approximate size for the value in a bin, and then the sum of sizes of all the values in will give the size of the record.

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful