Aerospike: save data as blob or use "bunkers"?

I need to store data in Aerospike. This engine, which supports "bins" ("bin", is similar to a column in a row or a field in a record). On the other hand, I can store my notes as serialized drops. Records are retrieved from the database atomically. That is, I do not need to retrieve some of the "columns" of the record, I need the whole record.

Question: What is the most efficient way to store data for such a scenario in terms of performance? Keep it uneserialized and use the "bins" to describe all the fields of the records, or save it as a serialized blob in 1 column?

+7
nosql aerospike
source share
2 answers

If you are sure that your only account is a full account and not separate mailboxes, it is better to store it as a single value. (Inside, multiple bins will require several mallocs beyond size limits). Infact, you can set the namespace configuration option "single-bin true", which will optimize the situation further. Keep in mind that after setting this configuration parameter, it can never be disabled even when the node is rebooted. You must clean the disks if you want to change this configuration. If the namespace is in memory, obviously this restriction does not apply.

In the future, if it is possible to access a subset of boxes, it is better to store them as baskets. Since it will save on network I / O, which will be much more than the malloc overhead.

+6
source share

Just add, if you store them as a BLOB, choosing the best serialization mechanism can further optimize operations in terms of network I / O.

In one of our use cases, we switched from the default Java Serialization to Kryo Serialization and, as a result, the data size was reduced to one third, and the response time of Aerospike was reduced to half on the client due to less data being transferred.

+4
source share

All Articles