Lab 9 (Introduction to Amazon DynamoDB)

This qwiklab will give you an understanding How to use Amazon DynamoDB to Create a simple table, how to add details, edit and delete.

In this qwiklab you will learn:-

  • How to Create an Amazon DynamoDB table
  • How to Load data in to an Amazon DynamoDB table
  • Querying Amazon DynamoDB
  • How to Delete an Amazon DynamoDB table

Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that need single-digit millisecond latency and consistency at any scale. It is a fully managed database and supports both key-value and document models. Its a great fit for mobile, web, ad-tech, IoT and Etc.

Note: DynamoDB customers get 25 GB of free storage, as well as up to 25 write capacity units and 25 read capacity units of ongoing throughput capacity (enough throughput to handle up to 200 million requests per month) and 2.5 million read requests from DynamoDB Streams for free. First 25 GB stored per month is free after that it will charge $0.25 per GB-month.

The images below will guide you through each step to complete the tasks which were mentioned above.

To create a DynamoDB > click on services and select DynamoDB 

1

click on Create Table to create a simple table.

2

Now give the table name as Music in the Table name box and for the primary key type Artist and select string.

3

click on the Add sort key check box and in the new field type SongTitle and leave the string selected. Leave the table settings to use the default settings and click on create.

4

Now that you know how to create a table. It’s time to modify the table you created by adding items. Click on Tables which is in the left navigation panel and select the table which was created. click on items.

5

Click on Create Item. when you click on create item a pop window will appear.

6

In the Artist attribute enter No one You Know in the VALUE field.
In the SongTitle attribute enter Call Me Today in the VALUE field.
To create an additional attribute click on the plus sign to the left of the attribute and then click on append.

7

After you have clicked on append select String and a new attribute will be added. In the FIELD box: enter AlbumTitle and in the VALUE box : enter Somewhat Famous.

8

Create another new attribute as the same way you created earlier. Click on Append and from the drop down list select Number.

9

In the FIELD box: enter YEAR and in the VALUE box : enter 2015. When the all the fields are filled click on save.

10

Now repeat the same steps to create another 2 items and add the following attributes to those.
For the 2nd Item add these Values which are mentioned below

In the Artist attribute enter No one You Know in the VALUE field.
In the SongTitle attribute enter My Dog Spot in the VALUE field.
In the FIELD box: enter AlbumTitle and in the VALUE box : enter Hey Now.
In the FIELD box: enter YEAR and in the VALUE box : enter 2014.

For the 3rd Item add these Values which are mentioned below

In the Artist attribute enter No one You Know in the VALUE field.
In the SongTitle attribute enter Somewhere Down The Road in the VALUE field.
In the FIELD box: enter AlbumTitle and in the VALUE box : enter Somewhat Famous.
In the FIELD box: enter YEAR and in the VALUE box : enter 2015.

12

To modify an existing Item in the table click on tables in the left navigational panel. Click on the Radio button next to Music and select it.

13

After selecting the table click on Items tab and select the item having the value of 2014.

14

After selecting click on Actions from the drop down list select Edit.

15

the Edit Item pop up window will appear Year Attribute value change 2014 to 2013 and click on Save.

16

17

Now lets see how to to search and to view the table information by querying the Table.

Click on Tables from the left Navigation panel menu. Click on the radio button next to Music table and select it. click the drop down labeled scan Music:Artist, SongTitle and on the revealed panel, use the drop-down and select scan to Query.

18

In the partition Key Artist String = Value box type No One You Know and click start Search and all the tracks by artist No one you Know will be displayed.

19

to search for a specific song in the sort key SongTitle String= type Call me Today click on start search.

20

As you can see the below image the result shows the song with the song title.

21

return to the query panel and keep the artist string value as No One You Know and clear the songtitle string= value box. Click on Add filter. In the new filter row Enter the attribute Year with 

2223

To delete the Table click Tables from the left navigation panel click on the radio button next to the music table and select it.

24

Click on Actions which is next to Create table. then select Delete table and click Delete. When the confirmation Panel appears click on delete again and the table will be deleted.

25

The below image shows the notification message about the table has been deleted.

26

Conclusion:
In this lab you have learned :

  • How to Create an Amazon DynamoDB table
  • How to Load data in to an Amazon DynamoDB table
  • Querying Amazon DynamoDB
  • How to Delete an Amazon DynamoDB table
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s