Menu
Amazon DynamoDB
Developer Guide (API Version 2012-08-10)

Supported Data Types

This section describes the supported primitive Java data types, collections, and arbitrary data types.

DynamoDB supports the following primitive data types and primitive wrapper classes.

  • String

  • Boolean, boolean

  • Byte, byte

  • Date (as ISO8601 millisecond-precision string, shifted to UTC)

  • Calendar (as ISO8601 millisecond-precision string, shifted to UTC)

  • Long, long

  • Integer, int

  • Double, double

  • Float, float

  • BigDecimal

  • BigInteger

DynamoDB supports the Java Set collection types. If your mapped collection property is not a Set, then an exception is thrown.

The following table summarizes how the preceding Java types map to the DynamoDB types.

Java typeDynamoDB type

All number types

N (number type)

Strings

S (string type)

BooleanN (number type), 0 or 1.

Alternatively, you can use @DynamoDBNativeBooleanType to map a Java Boolean to the DynamoDB BOOL data type. For more information, see Java Annotations for DynamoDB.)

ByteBufferB (binary type)
DateS (string type). The Date values are stored as ISO-8601 formatted strings.
Set collection typesSS (string set) type, NS (number set) type, or BS (binary set) type.

The SDK for Java also supports arbitrary data type mapping for DynamoDB. For example, you can define your own complex types on the client. You use the DynamoDBMarshaller interface and the @DynamoDBMarshalling annotation for the complex type to describe the mapping (Mapping Arbitrary Data).