Exploring Amazon DynamoDB Indexes | Scribe

    Exploring Amazon DynamoDB Indexes

    • Hafeez Baig |
    • 10 steps |
    • 35 seconds
    information ordinal icon

    Refer to the following guide to learn how to use IAM in the cloud\ <https://scribehow.com/shared/Creating_an_IAM_User_and_User_Group_in_AWS_Management_Console__hWNiiXlcRJKFqYZZEJD-cg>

    1

    Sign in to **AWS Management Console** as an **IAM User** **Pre-requisite** - Ensure you have selected the AWS region closest to your location\ For this guide, we will be using us-east-2 (Ohio) as a preferred choice

    2

    Type **DynamoDB** in the search bar and click on **DynamoDB** to view the **DynamoDB** Dashboard

    information ordinal icon

    **What is DynamoDB in AWS?** Amazon DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services (AWS). It is designed to provide high performance, scalability, and availability for applications that require low-latency access to large datasets. DynamoDB is a key component of AWS's database offerings and is widely used for a variety of use cases, ranging from mobile and web applications to gaming, IoT (Internet of Things), and more.

    3

    On the **DynamoDB** dashboard click on **Tables** from the left bar to view the Tables

    4

    Tables wizard will open, On the top right corner click on the **Create table** button

    5

    **Create table** wizard will open, scroll to the **Partition key** section and type "**name**" in the text input field with **String** Data type

    information ordinal icon

    **What is the Partition key in Amazon DynamoDB?** A partition key is a primary attribute that is used to distribute data across multiple partitions in the underlying storage infrastructure of DynamoDB. Every item in a DynamoDB table must have a unique partition key value, and DynamoDB uses this partition key to determine the partition in which the item will be stored.

    6

    On the **Sort key** section type "**city**" in the text input field with **String** Data type

    information ordinal icon

    **What is the Sort key in Amazon DynamoDB?** A sort key is an optional attribute that is part of the primary key for a table. While the partition key is required, the sort key is not, but it becomes relevant when you need to specify a sort order for items within a partition.

    7

    Scroll to the **Table settings** section, select the option **Customize settings**

    8

    Scroll to the **Secondary indexes** section and click on the **Create local index** button

    information ordinal icon

    **What is Secondary indexes in Amazon DynamoDB?** In Amazon DynamoDB, secondary indexes are additional data structures that allow you to query and retrieve items from a table using attributes other than the primary key. While DynamoDB tables are initially indexed on the primary key (either the partition key or a composite of partition key and sort key), secondary indexes provide flexibility by enabling queries based on different attributes, thus supporting various access patterns.

    9

    **New local secondary index** wizard will open, give "**country**" in the text input field for the Sort key with **String** Data type

    10

    Give "**country-index**" as the Index name in the text input field and click on the **Create index** button to create Local secondary index

    information ordinal icon

    Congratulations on successfully creating and exploring Amazon DynamoDB Indexes! Well done!