logo
Expand description

Amazon DynamoDB

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database, so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.

With DynamoDB, you can create database tables that can store and retrieve any amount of data, and serve any level of request traffic. You can scale up or scale down your tables' throughput capacity without downtime or performance degradation, and use the AWS Management Console to monitor resource utilization and performance metrics.

DynamoDB automatically spreads the data and traffic for your tables over a sufficient number of servers to handle your throughput and storage requirements, while maintaining consistent and fast performance. All of your data is stored on solid state disks (SSDs) and automatically replicated across multiple Availability Zones in an AWS region, providing built-in high availability and data durability.

If you’re using the service, you’re probably looking for DynamoDbClient and DynamoDb.

Examples

List Tables

The following code shows a simple example of using Rusoto’s DynamoDB API to list the names of all tables in a database.

use rusoto_core::Region;
use rusoto_dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput};
 
#[tokio::main]
async fn main() {
    let client = DynamoDbClient::new(Region::UsEast1);
    let list_tables_input: ListTablesInput = Default::default();
 
    match client.list_tables(list_tables_input).await {
        Ok(output) => match output.table_names {
            Some(table_name_list) => {
                println!("Tables in database:");
 
                for table_name in table_name_list {
                    println!("{}", table_name);
                }
            }
            None => println!("No tables in database!"),
        },
        Err(error) => {
            println!("Error: {:?}", error);
        }
    }
}

Structs

Contains details of a table archival operation.

Represents an attribute for describing the key schema for the table and indexes.

Represents the data for an attribute.

Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

For more information, see Data Types in the Amazon DynamoDB Developer Guide.

For the UpdateItem operation, represents the attributes to be modified, the action to perform on each, and the new value for each.

You cannot use UpdateItem to update any primary key attributes. Instead, you will need to delete the item, and then use PutItem to create a new item with new attributes.

Attribute values cannot be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests with empty values will be rejected with a ValidationException exception.

Represents the properties of the scaling policy.

Represents the auto scaling policy to be modified.

Represents the auto scaling settings for a global table or global secondary index.

Represents the auto scaling settings to be modified for a global table or global secondary index.

Represents the properties of a target tracking scaling policy.

Represents the settings of a target tracking scaling policy that will be modified.

Contains the description of the backup created for the table.

Contains the details of the backup created for the table.

Contains details for the backup.

Represents the input of a BatchGetItem operation.

Represents the output of a BatchGetItem operation.

An error associated with a statement in a PartiQL batch that was run.

A PartiQL batch statement request.

A PartiQL batch statement response..

Represents the input of a BatchWriteItem operation.

Represents the output of a BatchWriteItem operation.

Contains the details for the read/write capacity mode.

An ordered list of errors for each item in the request which caused the transaction to get cancelled. The values of the list are ordered according to the ordering of the TransactWriteItems request parameter. If no error occurred for the associated item an error with a Null code and Null message will be present.

Represents the amount of provisioned throughput capacity consumed on a table or an index.

Represents the selection criteria for a Query or Scan operation:

  • For a Query operation, Condition is used for specifying the KeyConditions to use when querying a table or an index. For KeyConditions, only the following comparison operators are supported:

    EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN

    Condition is also used in a QueryFilter, which evaluates the query results and returns only the desired values.

  • For a Scan operation, Condition is used in a ScanFilter, which evaluates the scan results and returns only the desired values.

Represents a request to perform a check that an item exists or to check the condition of specific attributes of the item.

The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the request asked for it. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.

Represents the continuous backups and point in time recovery settings on the table.

Represents a Contributor Insights summary entry.

Represents a new global secondary index to be added to an existing table.

Represents a replica to be added.

Represents a replica to be created.

Represents the input of a CreateTable operation.

Represents the output of a CreateTable operation.

Represents a request to perform a DeleteItem operation.

Represents a global secondary index to be deleted from an existing table.

Represents the input of a DeleteItem operation.

Represents the output of a DeleteItem operation.

Represents a replica to be removed.

Represents a replica to be deleted.

Represents a request to perform a DeleteItem operation on an item.

Represents the input of a DeleteTable operation.

Represents the output of a DeleteTable operation.

Represents the input of a DescribeLimits operation. Has no content.

Represents the output of a DescribeLimits operation.

Represents the input of a DescribeTable operation.

Represents the output of a DescribeTable operation.

A client for the DynamoDB API.

An endpoint information details.

Represents a condition to be compared with an attribute value. This condition can be used with DeleteItem, PutItem, or UpdateItem operations; if the comparison evaluates to true, the operation succeeds; if not, the operation fails. You can use ExpectedAttributeValue in one of two different ways:

  • Use AttributeValueList to specify one or more values to compare against an attribute. Use ComparisonOperator to specify how you want to perform the comparison. If the comparison evaluates to true, then the conditional operation succeeds.

  • Use Value to specify a value that DynamoDB will compare against an attribute. If the values match, then ExpectedAttributeValue evaluates to true and the conditional operation succeeds. Optionally, you can also set Exists to false, indicating that you do not expect to find the attribute value in the table. In this case, the conditional operation succeeds only if the comparison evaluates to false.

Value and Exists are incompatible with AttributeValueList and ComparisonOperator. Note that if you use both sets of parameters at once, DynamoDB will return a ValidationException exception.

Represents the properties of the exported table.

Summary information about an export task.

Represents a failure a contributor insights operation.

Specifies an item and related attribute values to retrieve in a TransactGetItem object.

Represents the input of a GetItem operation.

Represents the output of a GetItem operation.

Represents the properties of a global secondary index.

Represents the auto scaling settings of a global secondary index for a global table that will be modified.

Represents the properties of a global secondary index.

Represents the properties of a global secondary index for the table when the backup was created.

Represents one of the following:

  • A new global secondary index to be added to an existing table.

  • New provisioned throughput parameters for an existing global secondary index.

  • An existing global secondary index to be removed from an existing table.

Represents the properties of a global table.

Contains details about the global table.

Represents the settings of a global secondary index for a global table that will be modified.

Information about item collections, if any, that were affected by the operation. ItemCollectionMetrics is only returned if the request asked for it. If the table does not have any local secondary indexes, this information is not returned in the response.

Details for the requested item.

Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A KeySchemaElement represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement (for the partition key). A composite primary key would require one KeySchemaElement for the partition key, and another KeySchemaElement for the sort key.

A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

Represents a set of primary keys and, for each key, the attributes to retrieve from the table.

For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide the partition key. For a composite primary key, you must provide both the partition key and the sort key.

Describes a Kinesis data stream destination.

Represents the input of a ListTables operation.

Represents the output of a ListTables operation.

Represents the properties of a local secondary index.

Represents the properties of a local secondary index.

Represents the properties of a local secondary index for the table when the backup was created.

Represents a PartiQL statment that uses parameters.

The description of the point in time settings applied to the table.

Represents the settings used to enable point in time recovery.

Represents attributes that are copied (projected) from the table into an index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable operation.

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

Represents the provisioned throughput settings for the table, consisting of read and write capacity units, along with data about increases and decreases.

Replica-specific provisioned throughput settings. If not specified, uses the source table's provisioned throughput settings.

Represents a request to perform a PutItem operation.

Represents the input of a PutItem operation.

Represents the output of a PutItem operation.

Represents a request to perform a PutItem operation on an item.

Represents the input of a Query operation.

Represents the output of a Query operation.

Represents the properties of a replica.

Represents the auto scaling settings of the replica.

Represents the auto scaling settings of a replica that will be modified.

Contains the details of the replica.

Represents the properties of a replica global secondary index.

Represents the auto scaling configuration for a replica global secondary index.

Represents the auto scaling settings of a global secondary index for a replica that will be modified.

Represents the properties of a replica global secondary index.

Represents the properties of a global secondary index.

Represents the settings of a global secondary index for a global table that will be modified.

Represents the properties of a replica.

Represents the settings for a global table in a Region that will be modified.

Represents one of the following:

  • A new replica to be added to an existing global table.

  • New parameters for an existing replica.

  • An existing replica to be removed from an existing global table.

Represents one of the following:

  • A new replica to be added to an existing regional table or global table. This request invokes the CreateTableReplica action in the destination Region.

  • New parameters for an existing replica. This request invokes the UpdateTable action in the destination Region.

  • An existing replica to be deleted. The request invokes the DeleteTableReplica action in the destination Region, deleting the replica and all if its items in the destination Region.

Contains details for the restore.

The description of the server-side encryption status on the specified table.

Represents the settings used to enable server-side encryption.

Represents the input of a Scan operation.

Represents the output of a Scan operation.

Contains the details of the table when the backup was created.

Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL.

Represents the DynamoDB Streams configuration for a table in DynamoDB.

Represents the auto scaling configuration for a global table.

Represents the properties of a table.

Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a single DynamoDB table.

AWS-assigned tag names and values are automatically assigned the aws: prefix, which the user cannot assign. AWS-assigned tag names do not count towards the tag limit of 50. User-assigned tag names have the prefix user: in the Cost Allocation Report. You cannot backdate the application of a tag.

For an overview on tagging DynamoDB resources, see Tagging for DynamoDB in the Amazon DynamoDB Developer Guide.

The description of the Time to Live (TTL) status on the specified table.

Represents the settings used to enable or disable Time to Live (TTL) for the specified table.

Specifies an item to be retrieved as part of the transaction.

A list of requests that can perform update, put, delete, or check operations on multiple items in one or more tables atomically.

Represents a request to perform an UpdateItem operation.

Represents the new provisioned throughput settings to be applied to a global secondary index.

Represents the input of an UpdateItem operation.

Represents the output of an UpdateItem operation.

Represents a replica to be modified.

Represents the input of an UpdateTable operation.

Represents the output of an UpdateTable operation.

Represents the input of an UpdateTimeToLive operation.

Represents an operation to perform - either DeleteItem or PutItem. You can only request one of these operations, not both, in a single WriteRequest. If you do need to perform both of these operations, you need to provide two separate WriteRequest objects.

Enums

Errors returned by BatchExecuteStatement

Errors returned by BatchGetItem

Errors returned by BatchWriteItem

Errors returned by CreateBackup

Errors returned by CreateGlobalTable

Errors returned by CreateTable

Errors returned by DeleteBackup

Errors returned by DeleteItem

Errors returned by DeleteTable

Errors returned by DescribeBackup

Errors returned by DescribeContinuousBackups

Errors returned by DescribeContributorInsights

Errors returned by DescribeEndpoints

Errors returned by DescribeExport

Errors returned by DescribeGlobalTable

Errors returned by DescribeGlobalTableSettings

Errors returned by DescribeKinesisStreamingDestination

Errors returned by DescribeLimits

Errors returned by DescribeTable

Errors returned by DescribeTableReplicaAutoScaling

Errors returned by DescribeTimeToLive

Errors returned by DisableKinesisStreamingDestination

Errors returned by EnableKinesisStreamingDestination

Errors returned by ExecuteStatement

Errors returned by ExecuteTransaction

Errors returned by ExportTableToPointInTime

Errors returned by GetItem

Errors returned by ListBackups

Errors returned by ListContributorInsights

Errors returned by ListExports

Errors returned by ListGlobalTables

Errors returned by ListTables

Errors returned by ListTagsOfResource

Errors returned by PutItem

Errors returned by Query

Errors returned by RestoreTableFromBackup

Errors returned by RestoreTableToPointInTime

Errors returned by Scan

Errors returned by TagResource

Errors returned by TransactGetItems

Errors returned by TransactWriteItems

Errors returned by UntagResource

Errors returned by UpdateContinuousBackups

Errors returned by UpdateContributorInsights

Errors returned by UpdateGlobalTable

Errors returned by UpdateGlobalTableSettings

Errors returned by UpdateItem

Errors returned by UpdateTable

Errors returned by UpdateTableReplicaAutoScaling

Errors returned by UpdateTimeToLive

Traits

Trait representing the capabilities of the DynamoDB API. DynamoDB clients implement this trait.