Hey, everyone, and welcome back.
Now in today's video, we are going to discuss about the capacity modes in Dynamo DB.
Now, before we discuss in detail about the capacity mode, it is important for us to take a step back
to understand the challenge that the organization used to face when they had to set the RCA use and
use for the Dynamo DB table based on the application's access pattern.
Now, at this stage, we already know that we can specify the throughput capacity in Dynamo DB using
the read capacity units, which is the use and the right capacity units.
Now, one of the challenge at this stage is that if your application exceeds your provision throughput,
then it is subjected to the oral throttling.
For example, a client is requesting 400 KB of data from the Dynamo DB table and there is already a
throughput over provisioning that is currently happening.
A lot of requests are coming to the Dynamo DB table and it does not really have the appropriate RC use
and the WC use to handle the data.
And since the RCU is are not really present and there are too many requests, the Dynamo DB will start
to throttle the request and that can affect your oral production traffic.
Now, in order to ensure that your Dynamo DB table does not throttle because it can impact your production
application and also your business, it provides multiple features to work around that through the capacity
modes.
Now there are two primary capacity modes.
One is the provision mode, and second one is the on demand mode.
Now before we look into it in detail, let's quickly see on where exactly can we find it.
So when we create a Dynamo DB table with the customised setting over here within the capacity mode,
you have the on demand mode over here and you have the provision mode.
When you select provision mode, you see there are so many settings that are appearing over here.
When you select on demand, there are no settings.
It is very straightforward.
So it is important for us to understand the difference between them and also what these sets of settings
are now at a high level overview.
If you choose a provision mode, you specify the number of read and write per second that you require
for your application.
This is something that we have already discussed in our read and write capacity units video where you
can select the appropriate RC using the WQ depending upon the size of data that is expected and the
oral access patterns.
Along with that, ADA has also introduced one more feature associated with auto scaling.
So you can use the auto scaling to adjust your tables provision capacity automatically in response to
the traffic changes.
So if you look into the Dynamo DB table, you have either auto scaling on or off.
If you select it as off, then you can add the read and write capacity units manually.
So this is fine.
Now in case if there are any access patterns which requires more amount of data, then the throttling
will start to come into picture.
So in order to avoid that, you can enable the auto scaling over here and you can specify the minimum
and the maximum capacity units based on which the auto scaling would trigger.
Now let's also quickly look into the recommended traffic patterns in case if you are using a provision
mode.
Now, provision mode is a good option, if any of the following is true.
First is you have a predictable application traffic.
Second is you run application whose traffic is consistent or ramps gradually.
Let's say currently you are getting five read requests.
Now suddenly next second you are getting 500 requests.
So in case if you are using on demand, the on demand will not be able to scale very fast when you have
a spike of traffic.
However, if your application traffic is ramping up gradually on demand works pretty good.
Third is you can forecast the capacity requirements to control the overall cost.
The second type of capacity mode is on demand mode over here.
So the Amazon Dynamo DB on demand is capable of serving thousands of requests per second without any
capacity planning, and the dynamo may be on demand or first paper request pricing for read and write
requests so that you only pay for what you use.
So this is you can see the easiest way for the Dynamo be to work in case if you do not really want to
do capacity planning at all.
In this case, depending upon the request that you get, you will be charged accordingly.
Now, the question that comes is, since on demand is so good and so easy, why would anyone use provision
or why would anyone use provision with auto scaling?
And the answer to this is pricing.
Now, as we are discussing, if you select on demand, that's the only thing that you'll have to select.
You no longer have to worry about the capacity planning over here, but the primary challenger is pricing.
All right.
So I hope with this you understood the basics of capacity.
And depending upon your budget, depending upon your requirements, you can go ahead and select the
appropriate one for your application.
So with this will conclude today's video.