DynamoDB API

DynamoDB API

DynamoDB offers a wide range of powerful APIs for manipulating tables, reading and modifying data.

Amazon recommends using the AWS SDK (such as the Java SDK) instead of calling low-level APIs. Libraries make interacting with low-level APIs unnecessary. Libraries simplify common tasks such as authentication, serialization, and connections.

Manage tables

DynamoDB offers five low-level actions for Table Management −

  • CreateTable − This creates a table and includes the bandwidth set by the user. You need to set up a primary key, be it a composite key or a simple key. It also allows one or more secondary indexes.

  • ListTables - Provides a list of all tables in the current AWS user account and is bound to their endpoint.

  • UpdateTable - Changes the throughput and throughput of the global secondary index.

  • DescribeTable - Provides table metadata. for example, state, size, and indexes.

  • DeleteTable - This simply deletes the table and its indexes.

CreateTable − This creates a table and includes the bandwidth set by the user. You need to set up a primary key, be it a composite key or a simple key. It also allows one or more secondary indexes.

ListTables - Provides a list of all tables in the current AWS user account and is bound to their endpoint.

UpdateTable - Changes the throughput and throughput of the global secondary index.

DescribeTable - Provides table metadata. for example, state, size, and indexes.

DeleteTable - This simply deletes the table and its indexes.

Read data

DynamoDB offers four low-level actions for reading data −

  • GetItem - Takes a primary key and returns the associated item's attributes. It allows changes to the default settings that eventually match the reading settings.

  • BatchGetItem - Performs multiple GetItem queries on multiple items via primary keys with the ability to select one or more tables. Returns no more than 100 items and must remain less than 16MB. This allows for eventually consistent and strongly consistent reads.

  • Scan - reads all the elements of the table and returns a consistent set of results as a result. You can filter results by conditions. It avoids using an index and scans the entire table, so don't use it for queries that require predictability.

  • Query − Returns one or more table elements or secondary index elements. It uses the specified value for the partition key and allows you to use comparison operators to narrow the scope. It includes support for both types of consistency, and each response is subject to a 1MB size limit.

GetItem - Takes a primary key and returns the associated item's attributes. It allows changes to the default settings that eventually match the reading settings.

BatchGetItem - Performs multiple GetItem queries on multiple items via primary keys with the ability to select one or more tables. Returns no more than 100 items and must remain less than 16MB. This allows for eventually consistent and strongly consistent reads.

Scan - reads all the elements of the table and returns a consistent set of results as a result. You can filter results by conditions. It avoids using an index and scans the entire table, so don't use it for queries that require predictability.

Query − Returns one or more table elements or secondary index elements. It uses the specified value for the partition key and allows you to use comparison operators to narrow the scope. It includes support for both types of consistency, and each response is subject to a 1MB size limit.

To change the data

DynamoDB offers four low-level actions for data modification −

PutItem - Creates a new item or replaces existing ones. When it finds identical primary keys, it replaces the element by default. Conditional statements allow you to work by default and replace elements only under certain conditions.

BatchWriteItem - Performs multiple PutItem and DeleteItem queries and multiple tables. If one request fails, it does not affect the entire operation. His cap holds 25 items sized 16MB.

UpdateItem - Modifies existing item attributes and allows conditional statements to perform updates only under certain conditions.

DeleteItem - Uses a primary key to delete an item and also allows you to use conditional statements to specify conditions for deletion.