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.
Welcome back. In this demo, we will go through the process of creating your first DynamoDB table using the AWS web console. You should already be familiar with how to access the AWS console. If you are not, you may want to check out Cloud Academy's course, AWS Technical Fundamentals.
For this lecture, let's imagine that we are running an online store. We want to keep data about the orders that people place at this online store, so we'll start by creating a table to hold all of those orders. We want the table to look like this. Every record will have a numeric order ID and some other attributes about the order. Since DynamoDB doesn't enforce a strict schema, we don't really need to worry about any of the other attributes, except for the order ID.
Now, let's get started creating the table in the AWS console. When you log in to the AWS console, you will be taken to a page listing all of the different services offered by Amazon Web Services. Of course, we will need to click on DynamoDB to work with that service. Once we're in the DynamoDB console, we will see this Welcome page with a button in the center to create a table. Let's click that button now.
In order to create the table, we will need to provide a little bit of information. The first thing we will need is the table name. Since this table will hold the orders placed in our online store, let's name the table "Orders."
Next, we will need to identify one attribute or column as the primary key. The primary key is the only way that we will be able to look up individual records in the table. Since we know that each order has a numeric order ID, we can use that as the primary key. So if we give DynamoDB the order ID, it should give us back all of the attributes for the order that match that order ID.
DynamoDB primary keys can actually have two parts, a partition key and a sort key. A basic table only needs a partition key, so let's ignore the sort key until the next lecture. In this field, we need to specify the name of the primary key's partition key attribute and its data type. So let's enter "Order ID" as the partition key's attribute name, and let's select that it's a number.
For the rest of the settings, we can go ahead and use the default provided by Amazon. But if we uncheck the Use Default Settings checkbox, we can see a little more about what those defaults involve. We can see that there won't be any other indexes on this table, and that the table will be provisioned to allow up to five records to be read per second and five records to be written per second. This level of capacity will cost us about $3 per month.
The meaning of read capacity units and write capacity units is actually a little more complicated than that and will be explained later in this lesson. Let's say we wanted to allow 500 reads per second. If we do that, the estimated cost jumps to $51 per month. If we also provision 100 writes per second, the estimated cost jumps further to almost $97. These prices vary slightly between AWS geographic regions. The cheapest pricing is in the United States in the Northern Virginia and Oregon regions. Anyway, for this example we don't need that much throughput, so let's go back to the default, five read capacity units and five write capacity units.
Once the settings all look correct, we can click Create to start the process of creating the table. This will take us to a list of tables in our account, where you can see a message which says that the table is being created. After a few seconds, that message will go away. Once the message is gone, the console here shows us a bunch of information about our table. It shows that the table status is active, which means that it's ready to go. It shows that we've provisioned five read capacity units and five write capacity units. It shows an estimate of storage space being used by the table and an estimate of the number of records in the table.
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.