Skip to main content
Loading

Scalar Data Types

Aerospike records have one or more bins. Each bin holds a distinct scalar data type such as Integer or String, a collection data type (CDT) such as List or Map, a probabilistic data type such as HyperLogLog, or a geospatial GeoJSON data type.

note

A scalar data type is called a "particle" in some portions of the Aerospike documentation and in some messages.

The following are scalar data types:

Integer

Integers are 64-bit numeric values.

  • Each integer requires 8 bytes (64 bits) of storage.
  • For touchpoints in the database where integers need to assume a signed-ness, such as secondary index, the integer is signed, in the range of [ −(2^63) to 2^63 − 1 ].
  • An atomic increment operation can be applied to integer values. This can be used to implement counters.
  • Secondary indexes are supported on integer data types, for both equality and range queries.

Double

The double data type is stored in 64-bit IEEE-754 format.

  • An atomic increment operation can be applied to double values.

String

Strings are opaque byte arrays. They are not bound to an encoding, which allows you to use any character encoding for strings.

  • Strings assume UTF-8 encoding for touchpoints in the database where an encoding is required.
  • Client libraries can enforce encoding (for example, Java and C# clients always convert to UTF-8). Refer to the client library for your implementation.
  • Cross-language compatibility is determined by the application, and the application sets encoding for reads and writes.
  • Atomic prepend and append operations can be applied to string values.
  • Secondary indexes are supported on string data type for equality queries.
note

The default record size limit is 1 MiB, with a maximum configurable limit of 8 MiB, beginning in Aerospike Database version 7.0. Different size limits apply to previous versions. For more information, see the max-record-size server configuration parameter.

Boolean

The boolean data type holds a value of either true or false.

It is stored as a single byte on the server.

note

Support for boolean bin values was added in Aerospike Database 5.6. Prior to 5.6, only the List and Map data types could contain boolean values.

Blob/Bytes

Blobs are byte arrays of a specific size.

  • Any binary data of any type can be stored.
  • An extensive API of bitwise operations can be applied to byte values.
note

Bytes are not NULL terminated.

Language-Specific Serialized Blobs

Using their native-language serialization mechanism, the following Aerospike clients serialize unsupported data types into blobs. These blobs are deserialized automatically on reads.

  • Java
  • C# .NET
  • Python