Is it possible to get DynamoDB to automatically generate unique IDs when adding new items to a table?
I noticed the Java API mentions @DynamoDBAutoGeneratedKey so I’m assuming there’s a way to get this working with PHP as well.
If so, does the application code generate these IDs or is it done on the DynamoDB side?
Good question – while conceptually possible, this seems not currently available as a DynamoDB API level feature, insofar neither CreateTable nor PutItem refer to such a functionality.
The
@DynamoDBAutoGeneratedKeynotation you have noticed is a Java annotation, i.e. syntactic sugar offered by the Java SDK indeed:As such
@DynamoDBAutoGeneratedKeyis one of the Amazon DynamoDB Annotations offered as part of the Object Persistence Model within the Java SDK’s high-level API (see Using the Object Persistence Model with Amazon DynamoDB):