DynamoDB
Amazon DynamoDB is a fully managed NoSQL database with which you can create database tables that can store and retrieve any amount of data and serve any level of request traffic.
DynamoDB is a schema-less database that requires only a table name and a primary key when you create the table.
Lets get started with DynamoDB and create a table to store the details of students
Prerequisites
Log into AWS account with a valid user credentials
(Root user not preferred)
Lets Jump to the Recipe now
Steps to create
- Open the DynamoDB from the aws console
- Click on the create table button
Remember, DynamoDB is a schema-less database that requires only a table name and a primary key when you create the table.
- Specify the table name, My table name is going to be student_table since student details are being stored
Now,Lets Specify the Partition key. I am going to add Student_Id as the partition key.
Select the data type as Number
The partition key is part of the table's primary key which is a hash value that is used to retrieve items from your table and allocate data across hosts for scalability and availability.
We can also specify the sort key for the table but its optional
The sort key allows you to sort or search among all items sharing the same partition key.
Now, Scroll down and Make sure the Default Settings is selected for the Table settings
- Click Create table button
You can see the status as "Creating".
Now lets wait for couple of minutes to get the status changed to Active
Once the table status changed to Active
click on the table name link and you will be navigated to the table page.
Lets add some items Student details to the table
- Click on Actions Button
- Select Create Item
Lets add the below students to the table
Studentid: 101
Name: Jade
Name is the additional attribute where as studentid is the partionkey attribute
Specify the value of partition key and click on Add new Attribute button to add the Name attribute. Select String Type
Change the attribute name to Student_Name
Specify the value as "Jade"
This is the Form View, You can click the JSON View button to see the json version
- Click Create item
- You can see item getting added to the table
Top comments (1)
Good Recipe