So let's have a first look at DynamoDB.
And so DynamoDB allows us to create table.
As you can see, I just click on create table
and there's no such thing as
creating a database. So right away,
we have to create a table,
which makes it a serverless database.
So the table is going to be DemoTable.
And here we have to choose what's called a partition key
and optionally a sort key.
And the combination of these two columns
is going to make your primary key.
So to make it very simple, I would just have user ID
as my partition key, and I will not specify a sort key.
Now for the settings. This is where it gets important
from an exam perspective. So we're going to customize
the settings to have a look at all the options we have.
So, for read and write capacity settings,
we have two options.
We can either go on-demand or provisions.
So on demand is very simple.
We're going to pay for the actual reads and writes
that your application will perform.
And again, I said, this is great when your application has
unpredictable workloads, because on-demand
is two to three times more
expensive than provision capacity.
So use at your own risk obviously,
but this can be a great case and a great fit for many
kinds of scenarios.
And this is what the exam will test you on.
Now, provisioned is when you need to
manage and optimize your cost by allocating
read and write capacity in advance.
So we have two options. We have read capacity,
and write capacity. And so for these,
we have either auto scaling, on and off.
So auto-scaling applies to read and write capacity.
So if we specified off,
then we've provisioned capacity unit.
So we can set, for example,
I want to provision 10 capacity units,
and for right capacity you can say,
I want to provision five right capacity units. Okay.
So that's one way of doing it.
Or if we don't know ahead of time,
what we'll need in terms of capacity,
we can say, hey, min is max. Min is one.
Max is 100 and I want a target utilization of 70%.
And automatically auto-scaling activities will take place to
manage your read capacity,
to match about the 70% of the target utilization,
which is true for read capacity and for write capacity.
So I'm going to turn it off right now and I'll just set it
to one and one, but it shows you these two very,
very important options you need to know.
Next we have indexes. And indexes I will discuss them
in the next lecture, so let's skip them for now.
And by the way, if you want to know how to find out
which read and write capacity is right for you,
there's a capacity calculator.
Now this is a bit more complex.
This is more relevant for the developer exam.
So I'm not going to go over it.
Okay.
So we're going to scroll down.
So as you can see, because we have one RCU and one WCU,
we have an estimated cost of 71 cents
per month for this table.
So this gives you information around the
pricing of DynamoDB.
Okay, now we will enable encryption at rest,
and then I will click on create table.
So now that my table is created, I can click on it.
And then on the right hand side,
I can have a look at view items.
And this is just to show you how we can
insert items into our DynamoDB table.
So as we can see, you can create an item.
And when you specify a user ID, for example,
stephane under score 1 2 3,
and then we can start adding attributes into this table.
So we can say, name is Stephane Maarek.
And then we can have an example around another one,
for example, favorite movie,
and you can say Memento, and then it may be a number.
Favorite number...
42.
Okay. And we're going to create this item.
And as you can see, now, the item has been
inserted into my table.
So it's quite easy to reason about,
and we can create another item, obviously.
We can say Alice 4 5 6,
and again, we can set the name
of Alice to be Alice Doe.
And then we can just say
favorite...
movie and then Pocahontas.
Okay, great.
So I will create this item and maybe we can add also a
number called age in here.
I will say...
23.
Okay. Let's create this item.
So as you can see, in this example,
I specify different attributes for Alice, then Stephane.
And the idea is that in DynamoDB,
you don't need to have all the
attributes filled out for all the items.
Actually, every item can have different attributes.
So this show you the whole power of DynamoDB table,
and no SQL type of technology versus SQL type of technology.
So it's very simple.
Now we have Alice and Stephane in our table,
and I'm not going to go too deep into DynamoDB.
As you can see, there are a lot of options.
So if we go back into our table,
there are a lot of options in here available to us.
But in the next lecture,
what I will do is I will describe what are some of these
options that can be important for the exam are.
And what you need to see just in this lecture was how to set
the read and write capacity units or the on-demand mode,
as well as inserting some data into the DynamoDB table.
So I hope you liked it,
and I will see you in the next lecture.