Hi, everyone, and welcome back.
Now in today's video, we are going to discuss about the core components of Dynamo DB.
Now in Dynamo DB tables, items and attributes are one of the core components that you'll need to work
with.
Now, at a high level overview table is a collection of items, and each item is a collection of attributes.
For example, let's say that you have a Dynamo DB table over here.
Now within this table you see that you have collections of items.
So you have item number one associated with the user idea of one, and item number two associated with
the user ID of two.
Along with that, this table also contains a set of attributes.
So your user ID name, age and interest are the attributes over here.
The second important thing that we need to note is associated with the primary key.
Now, each item in a table has a unique identifier, also referred to as a primary key that distinguishes
the item from all other items in the table.
For example, in this table there are two items, and one of the primary distinguishes here is the user
ID.
So the user ID associated with the name of Hirsch's, one associated with the name of Z List two.
And if say there are 100 items here, what is one unique thing that would differentiate all of those
hundred items and that would be user ID name can be same, h can be same, interest can be same, but
the user ID is something that will be different across all of the items.
So this is what is referred to as a primary key.
No other than the primary key, the table is schema less, which means that neither the attributes nor
the data types needs to be defined beforehand.
So whenever you create a new item, one of the common things that you will have to add is user ID.
Apart from user ID, it is not necessary to give a name, not necessarily to give a H, not necessary
to give an interest and so on.
User ID Since it is a primary key, you'll always have to define it.
So let's do one thing.
Let's go ahead and look into it practically.
Now from the Dynamo DB service, you can go ahead and quickly create a new table.
Let's create a new table.
I'll just call it as a demo hyphen table.
Now within here you'll have to specify the primary key.
So similar to what we are discussing, the primary key lets us keep it as user ID and I'll go ahead
and create a table.
So the status is creating if will quickly refresh here.
You see the status is now active.
Now let's open this table and within the actions let's quickly create a new item.
Now within this item you will see that your primary key over here, you will always have to define over
here.
If we create an item without defining the value you see, it immediately gives an error stating you
must provide a partition key attribute user ID with a non empty value.
So let's just call it as one.
We'll add one more attribute here within the name, let's just call it as Alice once.
Then you can create an item over here.
Now again, note that we are adding the attribute similar to what we are discussing.
Various things like user ID, name age interest are nothing but the attributes and this is what you
have to do.
And for each attribute you can define a data type like string number boolean in case if you add a new
attribute of number will give an H.
And if you try to add a character or you see it does not work, you'll have to define a number once.
Then you can create a new item.
Let's quickly do an explore table items over here.
And in this case, you see it states one item written, and this specific part is an item warrior.
All right.
So I hope that this at a high level overview, you understood the basics of attributes.
You understood the basics of items, you understood the basics of primary key and how attribute is associated
with a specific data type.
And depending upon the data type, the value would be allowed or it would not be alone.
Great.
So once this is, then you can go ahead and quickly delete the table that you have configured.
Let's do that.
And if I refresh, our table is deleted.
So that's the high level overview.
And with this will conclude today's video.