Document API differences between version 1 and version 2 of the AWS SDK for Java
The Document API supports working with JSON-style documents as single items in a DynamoDB table. The V1 Document API has a corresponding API in V2, but instead of using a separate client for the document API as in V1, V2 incorporates document API features in the DynamoDB enhanced client.
In V1, the Item class represents an unstructured record from a DynamoDB
table. In V2, an unstructured record is represented by an instance of the EnhancedDocument
The table below compares the differences between the Document APIs in V1 and V2.
| Use case | V1 | V2 |
|---|---|---|
| Create a document client |
|
|
| Reference a table |
|
|
| Work with semi-structured data | ||
| Put item |
|
|
| Get item |
|
|
| Work with JSON items | ||
| Convert a JSON structure to use it with the Document API |
|
|
| Put JSON |
|
|
| Read JSON |
|
|
API reference and guides for document APIs
| V1 | V2 | |
|---|---|---|
| API reference | API reference | API reference |
| Documentation guide | Amazon DynamoDB Developer Guide | Enhanced Document API (this guide) |