AWS DynamoDb –A Serverless, Key-value & NoSQL database

Sabina Akter
4 min readJul 17, 2022

--

Amazon DynamoDB is a fully managed, serverless, key-value, NoSQL database designed to run high-performance applications at any scale. DynamoDB offers built-in security, continuous backups, automated multi-Region replication, in-memory caching, and data export tools.

Pic: AWS Amazon DynamoDB architecture

Use cases:

  • Develop Software Applications
  • Create media metadata stores
  • Deliver seamless retail experiences
use case AWS DynamoDB

Key terms:

  • Serverless: Serverless architecture allows developers to build and run services without having to manage the underlying infrastructure. There are still have server that Cloud vendor is responsible for that infrastructure.
  • NoSQL: NoSQL is known as a non-relational database that provides a process for storage and retrieval of data. The data stores in a variety of ways such as documents, key-value, wide-column, and graphs.

AWS DynamoDB Project prerequisites:

o AWS account with IAM User

o IAM user with permission

o You need to know how to create EC2 instance on AWS

Srep1: Create a DynamoDB Table:

Go to AWS Console → Search for DynamoDB → click Create Table

o Fill out the table details with a Table name and Partition key name. The Partition key is a part of the table’s primary key. The partition key section states what we’re going to store in this table and this can be a string, binary, or a number. The Sort key is optional

o Keep the Table setting as a default

o You can also skip the Tags part for now

o Once you click on create table, it will create a table.

Pic: Create Table
Pic: Table created successfully

o The table Demo_Table2 has been created successfully.

Now, Click on the name of the table and from the right corner Action tab click on the drop down and select create item and type below information’s.

User_id 1234

first_name John

last_name Robert

favorite_number 10

Pic: Create item

Then hit create item from the bottom right corner. Now successfully Demo_Table2 has been created with the data has been provided. Then create another item same way with the below information:

User_id 5678

first_name John

last_name Doe

favorite_number 15

Pic: 2nd item created

Step 2: Create an EC2 Instance:

Go to AWS Console → Search for EC2 → Create EC2 instance → Configure instance details →Launch Instance

Step 3: Grant EC2 Instance read access to DynamoDB

Create new IAM Role named on DynamoDb_ReadOnly_Access → Attach the DynamoDB read-only permissions to the IAM user

Pic: IAM role apply for EC2 instance

Step 4: Connect EC2 with web cli

Now, go to EC2 instance from the AWS console select the EC2 instance click the dropdown from the Action tab click connect. It will connect the aws cli with the EC2 instance in a different tab

Step 5: Scan the DynamoDB table => Demo_Table2 by using the AWS CLI in EC2 Instance

This cli command will scan operation to return all the data attributes for each item in the Demo_Table2 table. If you want to insert, delete and update the data, you have to give the IAM user write permission.

Pic: aws dynamodb

Happy Learning !!

Conclusion:

I had some issues of naming table, figured out I already had a table with the same table name : ) . I have deleted old table and create a new one fixed the issue. Table name can’t be duplicate.

--

--

Sabina Akter
Sabina Akter

Written by Sabina Akter

Infrastructure Engineer/Cloud Engineer at Fox

No responses yet