Open In App

AWS DynamoDB – Create a Global Secondary Index

Improve
Improve
Like Article
Like
Save
Share
Report

Amazon DynamoDB is a NoSQL-managed database that stores data in the form of key-value pairs and document data. A Dynamodb table stores items which are nothing but key-value pairs. By default, each item will have a partition key to differentiate between the items. 

When need to perform many kinds of queries, taking different attributes as query criteria, then you can create one or more global secondary indexes and issue Query requests against these indexes in Amazon DynamoDB.

 For example, a table named movies have been created in DynamoDB. See the below image:

Table

Create a global secondary index:

To create a secondary index in DynamoDB follow the below simple steps:

Step 1: Click on the name of the table. Navigate to the Indexes tab of the table. Click on create index button.

Step 2: Provide the primary key name. In this case, we have provided the Name. The index name is more of a table name. Thus, when we add a secondary global index and the results obtained upon query are stored in the specified index name. Rest leave everything as default. Click create index button.

In the above images, we see that a secondary global index has been created with the name Name-index. 


Last Updated : 28 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads