Overview of DynamoDB Tables, Items, Attributes, and types in the AWS console

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet

DynamoDB's concept of tables roughly maps to the idea of a table or collection you might be used to from other systems. We cover what Attributes are and why they matter, as well as introducing Items, DynamoDB types, and some useful console functionality in the browser.

Instructor: [00:00] Here we are in the AWS Console and we're looking at a list of all the tables that I happen to have in this account that are DynamoDB tables. The core components of a DynamoDB table are the tables, the items in those tables and the attributes. We'll go ahead and I'll click into one of these tables that has some data in it for a product that I'm building.

[00:23] If we go to items, it'll do a scan on the table and show us a set of all the items in the table.

[00:29] Now, we'll go into a little bit more of the data modeling and what these keys are in a couple videos. If we scroll down to one of these items, let's say this one, this item in my DynamoDB table is just some metadata about a note that I took on slate JS.

[00:43] The entire list of items is the table, which maps fairly well to a table in any other SQL database or something like that, if you're familiar with one of those systems. If we click up here in the top left and we go to text, you can see that an item, which is what we're looking at here, a single item in our DynamoDB table shows us basically a JSON value.

[01:04] That's the key insight for how tables, items and attributes are related in DynamoDB. We have a table of JSON objects, and the attributes are the top-level keys in that JSON object.

[01:15] In this case, we have data entity PK and SK. The sub keys are not called attributes, only these top levels are. If you look at data entity PK and SK, you can see that for this item, we can see PK, SK, data. If we scroll over, we would see entity as well.

[01:32] If we click on this little checkbox that says DynamoDB JSON, what we see is all the type information associated with all of the keys. DynamoDB types are represented by a single letter usually. In this case, we have a PK, which is a string of this UUID with this MDX prefix. This SK is also a string with a workspace prefix and UUID.

[01:53] Data is a map which is the same as saying that data is a JSON object with the keys created_at title and updated_at. You can see that created_at as a number and updated_at is also a number, which happened to be Unix epoch timestamps. We've got a title here, which is also a string.

[02:10] Conceptually, when we talk about tables, we can think of them as buckets of JSON objects that we can access by key that can have attributes that we can query on and value so we can return.