How to handle unsupported datatypes in Aerospike

520 views Asked by At

It is known that some of datatypes like Float are not supported by Aerospike server. But they are handled at client side. For example Python client from version 1.0.40 supports unsupported datatypes using serialization.

I would like to know how exactly this is handled by the client while retrieving the data from server. I mean how the client knows the bin should be unserialized and render to the user.

This will help me to handle from outside the client if the client language I am using is not supporting this feature.

Thanks.

2

There are 2 answers

3
sunil On

Anything other than the standard datatypes, will be stored as python blob (an internal datatype). Python's serialization mechanism is used to generate the bytes. Aerospike clients send the fact that it is sending a python blob. Aerospike server also stores this fact and return the info back when the bin is read. This is interpreted by the client and if its a python blob type, it runs the bytes through python's deserializer. This will reconstruct the python object. Similar thing is done in Java too and stored as java blob using java's serializer/deserializer.

Obviously, these python blobs cannot be read in a java client or vice versa. So, do not expect cross language functionality when using non-native types.

4
Ronen Botzer On

Serialization in the Python client is explained in more details in a section right above the set_serializer method