Amazon DynamoDB Tutorial – A Complete Guide

Last updated on Sep 03,2024 28.9K Views
Priyaj Kumar is an AWS aspirant working as a Research Analyst at... Priyaj Kumar is an AWS aspirant working as a Research Analyst at Edureka. He is working on different AWS services and has good knowledge...

Amazon DynamoDB Tutorial – A Complete Guide

edureka.co

DynamoDB is a fully managed NoSQL database service provided by Amazon. These days, databases have become the backbone for any company irrespective of how big they are. Traditional database systems which were initially used, are not the go-to solution today because of the dynamic change in requirements and type of data procured. In this Amazon DynamoDB tutorial, I will be discussing the new and fast way of storing and retrieving data using DynamoDB.

If you wish to make a career in cloud computing and explore the different services provided by AWS, take a look at the AWS Training and Certification.

 

What Is DynamoDB?

Amazon DynamoDB is a fully managed NoSQL service that works on key-value pair and other data structure documents provided by Amazon. It requires only a primary key and doesn’t require a schema to create a table. It can store any amount of data and serve any amount of traffic. With DyanmoDB, you can expect a good performance even when it scales up. It is a very simple and small API that follows key-value method to store, access and perform advanced data retrieval.

DynamoDB comprises of three fundamental units known as table, attribute, and items. A table holds a set of items, an attribute is the simplest element that stores data without any further division and item holds a set of attributes.

Now that you know what is DynamoDB, let’s move further in this Amazon DynamoDB tutorial and introduce you to the terms used here.

Terminologies Associated With DynamoDB

Here with DynamoDB, everything is kept simple, the terms used with DynamoDB are easy to understand which makes it unique from the rest of the Database services. The terms used are as follows:

These are the different terms used, without any further delay let’s proceed with the DynamoDB tutorial and find out how to access a table.

Accessing Amazon DynamoDB

Accessing DynamoDB is very easy and can be done using the following methods:

Features Of DynamoDB

DynamoDB is a NoSQL database service. DynamoDB is designed in such a way that the user can get high-performance, run scalable applications that would not be possible with the traditional database system. These additional features of DynamoDB can be seen under the following categories:

  1. On-demand capacity mode: The applications using the on-demand service, DynamoDB automatically scales up/down to accommodate the traffic.
  2. Built-in support for ACID transactions: DynamoDB provides native/ server-side support for transactions.
  3. On-demand backup: This feature allows you to create a complete backup of your work at any given point of time.
  4. Point-in-time recovery: This feature helps you with the protection of your data in case of accidental read/ write operations.
  5. Encryption at rest: It keeps the data encrypted even when the table is not in use. This enhances security with the help of encryption keys.

DynamoDB API

DynamoDB is a database tool and to interact with an application, it requires API. The APIs in DynamoDB are:

Control Plane

Control Plane consists of operations responsible for “Creating” and “Managing” a DynamoDB table. The API operations that can be used are as follows:

Data Plane

Data Plane consists of “CRUD” operation, i.e. “Create“, “Read“, “Update“, and “Delete” options to perform different actions on your table. Here in Data Plane, there are multiple operations that can be done on a table. The operations here are as follows:

DynamoDB Stream

DynamoDB Stream is nothing but a service used to track data stream that is loaded into a table and retrieved from a table. To modify the streaming, the user can use the following commands:

So, now that you have a decent idea about the different APIs supported by DynamoDB. Let’s take a look at the different case studies where customers have benefited with DynamoDB.

DynamoDB: Case Studies

I have listed down the case studies of some big companies and startups, as to how they benefited using DynamoDB.

  1. MLB Advanced Media
    MLBAM said in one of their reviews about Amazon DynamoDB that it helped them to scale up the support for games on a single day, DynamoDB also helped them to power the queries and support for fast data retrieval. 
  2. Expedia
    Expedia’s real-time analytics application collects data for test & learn experiments. This experiment processed nearly 200 million messages daily, they stated that DynamoDB was easy to setup and the monitoring was easier and scaling was smooth and that’s the reason they moved to using DynamoDB.
  3. Nexon
    Nexon stated that they used Amazon DynamoDB as their primary database for blockbuster mobile game HIT. They stated that Nexon’s HIT leveraged DynamoDB to deliver a steady latency to deliver a fantastic mobile gaming experience.

This is how the trending NoSQL database “Amazon DynamoDB” helped companies to reach the pinnacle of user experience. Let’s move further in this Amazon DynamoDB tutorial and see how to implement the different queries.

Demo: Creating, Inserting And Querying A Table In DynamoDB

Let’s find out how to create a table in DynamoDB.

Step 1: Navigate to the DynamoDB section in AWS or click here. Select “Create Table“. 

Create Table – Amazon DynamoDB Tutorial

Step 2: Fill in with the necessary details and click on “Create“.

Create Table – Amazon DynamoDB Tutorial

Step 3: You can view your table being created. Click on “Overview” to understand your table, click on “Items” to edit, insert and query on the table. There are many more options you can use to understand your table better.

Table Description – Amazon DynamoDB Tutorial

Now that you have created a table, let’s go ahead and insert a few items and understand how NoSQL works.

Step 1: Navigate to “Items” and click on “Create item“.

Create Item – Amazon DynamoDB Tutorial

Step 2: It will open a JSON file where you can add different items. Click on the “+” symbol and select “Append” and select what type of data you want to enter.

Insert Item – Amazon DynamoDB Tutorial

Step 3: This is what it looks like after adding multiple columns to your table. Click on “Save“.

Insert Item – Amazon DynamoDB Tutorial

Step 4: Since it is a NoSQL architecture, you can play around with the columns you add to the table. E.g. “Position“.

Insert Item – Amazon DynamoDB Tutorial

Step 5: This is how your table will look like once you have inserted the data.

Display Table Content – Amazon DynamoDB Tutorial

Now that we have a table ready, let’s go ahead and look at some basic queries.

Step 1: Here you can frame your query and click on “Start Search” to get the desired result.

E.g. I am searching for all the mobile numbers that are greater than or equals to “1234“.

Search Table – Amazon DynamoDB Tutorial

Step 2: Here, I am searching for the record which has EmpId as “ED4“.

Search Table – Amazon DynamoDB Tutorial

This is a small tutorial on how to use DynamoDB to suffice your needs. I hope you found this Amazon DynamoDB tutorial informative.

If you wish to learn more about Cloud Computing and build a career in Cloud Computing, then check out our Cloud Computing Courses which comes with instructor-led live training and real-life project experience. This training will help you understand Cloud Computing in depth and help you achieve mastery over the subject.

Got a question for us? Please mention it in the comments section and we will get back to you or post your question at Edureka | Community. At Edureka Community we have more than 1,00,000+ tech-fanatics ready to help.

Upcoming Batches For AWS Certification Training
Course NameDateDetails
AWS Certification Training

Class Starts on 18th November,2024

18th November

MON-FRI (Weekday Batch)
View Details
AWS Certification Training

Class Starts on 30th November,2024

30th November

SAT&SUN (Weekend Batch)
View Details
AWS Certification Training

Class Starts on 14th December,2024

14th December

SAT&SUN (Weekend Batch)
View Details
BROWSE COURSES