Supported data types
The Aerospike database supports the following native types:
Click to view data types
- Blob
- Boolean
- Float
- GeoJSON
- HyperLogLog
- Infinity
- Integer
- JSON
- List
- Map
- Null
- String
- Wildcard
When a value is set in Go, the Aerospike library automatically determines the best native type for storage:
int
convert to an internal number format.- Strings are stored in UTF-8 encoding.
[]byte
is stored as blobs.
The Aerospike internal typing system automatically converts types. Cross-language type issues are handled internally by the Aerospike libraries. For example, an Aerospike string is stored in UTF-8 format to allow Java and C# (which both use Unicode preferentially) to interact transparently with Go and Python (which use UTF-8) and C (which does not have a standard internal character encoding).
The Aerospike Go client does not automatically serialize any other data types (for example, arbitrary structs). To do this, the application must serialize the object into a byte array and pass it to the library.
Blobs must be manually deserialized on retrieval. If another language retrieves these blobs, they appear as a regular blob. Objects serialized using another language serialization system appear to Go as a blob.