Amazon DynamoDB

DynamoDB Quick Notes (Numbers)

DynamoDB is very important for clearing AWS Certified Developer Associate.

Quick Notes (Numbers)

  1. DynamoDB synchronously replicates data across three facilities in an AWS Region.

  2. DynamoDB Streams captures a time-ordered sequence of item-level modifications in any DynamoDB table, and stores this information in a log for up to 24 hours.

  3. In DDB, the total value of an item (including all attribute names and values) cannot exceed 400KB.

DynamoDB Accelerator (DAX) Overview

Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for DynamoDB that enables you to benefit from fast in-memory performance for demanding applications. DAX improves the performance of read-intensive DynamoDB workloads so repeat reads of cached data can be served immediately with extremely low latency.

DynamoDB Time-to-Live (TTL)

DynamoDB Time-to-Live (TTL) is a mechanism that lets you set a specific timestamp to delete expired items from your tables. Once the timestamp expires, the corresponding item is marked as expired and is subsequently deleted from the table. TTL can help you reduce storage usage and reduce the cost of storing data that is no longer relevant.


Use cases

There are two main scenarios where TTL can come in handy:

DynamoDB Storage Backend for Titan Graph Database

The DynamoDB Storage Backend for Titan is a plug-in that allows you to use DynamoDB as the underlying storage layer for Titan graph database. It is a client side solution that implements index free adjacency for fast graph traversals on top of DynamoDB.  Using DynamoDB enables you to run graph workloads without having to manage your own cluster for graph storage.

Security and Fine Grained Access Control (FGAC) in DynamoDB

Fine Grained Access Control (FGAC) gives a DynamoDB table owner a high degree of control over data in the table. The table owner can indicate who (caller) can access which items or attributes of the table and perform what actions (read / write capability). FGAC is used in concert with AWS IAM, which manages the security credentials and the associated permissions.

DynamoDB Cross-region Replication

DynamoDB cross-region replication allows you to maintain identical copies (called replicas) of a DynamoDB table (called master table) in one or more AWS regions. After you enable cross-region replication for a table, identical copies of the table are created in other AWS regions. Writes to the table will be automatically propagated to all replicas.


DynamoDB Cross-region Replication - Use Cases

You can use cross-region replication for the following scenarios.

DynamoDB Triggers Overview

DynamoDB Triggers is a feature which allows you to execute custom actions (as code) based on item-level updates on a DynamoDB table. Some use cases include sending notifications, updating an aggregate table, and connecting DynamoDB tables to other data sources.


Additional Notes on DynamoDB Secondary Indexes

These are some additional notes on GSI and LSI. Please refer to AWS docs or FAQs for more details.


Global Secondary Index - Provisioned Throughput

Different throughput for tables and global secondary indexes may be required in following scenarios:

  • A GSI that contains a small fraction of the table items needs a much lower write throughput compared to the table.

Useful APIs for Working with Secondary Indexes in DynamoDB

These are notes on some useful APIs to work with GSI and LSI.



GSI support Query and Scan.

In addition to the common query parameters, a Query command explicitly includes the name of the index to operate against.

A query can use only one index.

A Query operation only searches index key attribute values and supports a subset of comparison operators.

DynamoDB Secondary Indexes in Detail

For efficient access to data in a table, DynamoDB creates and maintains indexes for the primary key attributes. You can also create one or more secondary indexes on a table, and issue Query requests against those indexes. Secondary indexes are also specified with a partition key and a sort key.