Creating a DynamoDB table, creating, and deleting items using the AWS console

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 4 years ago

We

  • create a DynamoDB table
  • talk about primary keys, partition keys, and sort keys
  • insert an item with a pk, sk and some JSON data
  • take a look at the dynamo representation of that data, including type information
  • then delete the item

Man 1: [00:00] from the AWS console go to find services and type in DynamoDB. Once the page loads you'll see a giant create table in the beginning. If you don't see that you can also go to the left and go to tables.

[00:13] We'll name our table to dos and then go to the option of specifying a partition key and a sort key. Together these form what you might know as a primary key from another database. We're going to go with the very generic keys, PK and SK or partition key and sort key, for reasons we'll see later.

[00:29] The default settings set a provision to capacity within the free tier, but we could also set this database up to be an on-demand database.

[00:40] After the table is created we can see the Dynamo streams are not enabled, and the option to manage streams. We can scroll down and see a bunch of other table details, which is where the point in time recovery is turned on, what our encryption type is and what our provision read capacity units are.

[00:54] If we go to items, it scans the table by default to show us all the items in our database, of which we have none...

[00:59] We can scroll down and see a bunch of our other table details, which is where the point in time recovery is turned on what our encryption type is and what our provision read capacity units are.

[01:07] If we go to items, it scans the table by default and show us all the items in our database of which we have none. Let's create one. Then I create item to create an item and fill out the PK and SK was string values. That's the only thing around right now, the values don't really matter.

[01:17] We also want to append a map or the key of data or we'll store additional data about this todo and that we can click in to edit this object. We'll go up to the left, we'll change from tree view to text view in which we had a JSON value. Using the JSON value interface, we can enter our data and save.

[01:33] Note that the way the data is stored in the database for our map as such that our text key has an object inside of it with a key of S and a value of my first todo. The S is the type of the value as we'll go into more later.

[01:49] Depending on which client you use to interact with DynamoDB, you'll either have to know about and use these type values or the client will take care of it for you. We can also delete the item which we'll do now.

egghead
egghead
~ 26 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today