Creating DynamoDB Tables
Reading and Writing Data
Queries and Scans
Working with Large Tables
This course provides an introduction to working with Amazon DynamoDB, a fully-managed NoSQL database service provided by Amazon Web Services. We begin with a description of DynamoDB and compare it to other database platforms. The course continues by walking you through designing tables, and reading and writing data, which is somewhat different than other databases you may be familiar with. We conclude with more advanced topics including secondary indexes and how DynamoDB handles very large tables.
You will gain the following skills by completing this course:
- How to create DynamoDB tables.
- How to read and write data.
- How to use queries and scans.
- How to create and query secondary indexes.
- How to work with large tables.
You should take this course if you have:
- An understanding of basic AWS technical fundamentals.
- Awareness of basic database concepts, such as tables, rows, indexes, and queries.
- A basic understanding of computer programming. The course includes some programming examples in Python.
See the Intended Audience section.
This Course Includes
- Expert-guided lectures about Amazon DynamoDB.
- 1 hour and 31 minutes of high-definition video.
- Expert-level instruction from an industry veteran.
What You'll Learn
|Video Lecture||What You'll Learn|
|DynamoDB Basics||A basic and foundational overview of DynamoDB.|
|Creating DynamoDB Tables||How to create DynamoDB tables and understand key concepts.|
|Reading and Writing Data||How to use the AWS Console and API to read and write data.|
|Queries and Scans||How to use queries and scans with the AWS Console and API.|
|Secondary Indexes||How to work with Secondary Indexes.|
|Working with Large Tables||How to use partitioning in large tables.|
If you have thoughts or suggestions for this course, please contact Cloud Academy at email@example.com.
Now we're going to get into how to work with the data in your tables. This video will demonstrate how to use the AWS Web Console to interactively view and edit the data stored in a DynamoDB table. Let's start by going back to the AWS Web Console.
We're back at the dashboard that shows us general information about DynamoDB system status and some aggregate information about our account. From here, let's click the tables link on the left side of the screen. Now if we click on the name of the Order Line Items table we'll see the overview for that table. To work with specific records in the table, we'll click the Items tab.
The Items tab gives us a view of all of the data in this table. Although Order ID is the partition key, the primary key for this table, the data is not sorted by Order ID. That's because of how DynamoDB stores data internally, splitting it up into many partitions. When you load any set of records, DynamoDB loads data from the table's partitions in parallel so they're not necessarily going to be in any kind of order. We can see the first 100 items on the screen and we can click the little arrow here to scroll to the next 100 items.
Anytime you're viewing a list of records in the items tab of the console you can edit any of the attributes by hovering over them and clicking the pencil icon. Let's mark one of these items as "shipped." We can edit the status field, change it to "shipped," and click save. That's all we need to do to change a single attribute. You can use this method to change any attribute except the primary key column. If you want to add or remove attributes or make changes to a few attributes at once, you can click on the primary key. This will open a window that lets us edit a single item in more detail. We could remove the color attribute by clicking on the little plus icon there, or we can append a new attribute. Say we want to add a string: we could name it "size" and enter the value XL. We can also just click on an attribute's value to make changes to it, like changing the size to XXL.
When we clicked to append a new attribute we were asked to specify the data type for the attribute. There are actually quite a few data types listed here. The first three are pretty standard: strings of text, binary data, and numbers. The next three allow us to add multiple values to a single attribute. These are called sets because they are not stored in any order and you can't repeat a value more than once in a set. Next are maps which allow you to store more structured data with nested hierarchy, and lists which are arrays of many values this time stored in order. Finally is Boolean which lets you store true or false.
Let's save these changes and go back to the list of items in the table. From this list, we can also add a new record just by clicking the create item button at the top left of the item's panel. This brings up a data entry screen similar to the one we just saw. Because DynamoDB is schemaless, the only attribute that we are prompted for is the partition key: Order ID. If we want to add a new item from scratch we would need to decide what other attributes should be included in this item and then add them individually like we did on the previous screen. Let's cancel out of this for now.
One final action we should cover is deleting items from the table. We can do that by clicking the select box to the left of one or more items, then going to actions and choosing delete. We are prompted to confirm that we want to delete these items, and as soon as we click delete here, they're gone from the table.
We've discussed basic data manipulation using the web console. The next video will discuss manipulating data using the API.
Ryan is the Storage Operations Manager at Slack, a messaging app for teams. He leads the technical operations for Slack's database and search technologies, which use Amazon Web Services for global reach.
Prior to Slack, Ryan led technical operations at Pinterest, one of the fastest-growing social networks in recent memory, and at Runscope, a debugging and testing service for APIs.
Ryan has spoken about patterns for modern application design at conferences including Amazon Web Services re:Invent and O'Reilly Fluent. He has also been a mentor for companies participating in the 500 Startups incubator.