DynamoDB Capacity Modes

DynamoDB is one of the greatest services of AWS. It is a NoSQL database which is fully managed and is very easy to use in Lambda functions. It not only has many nice features like streams, indexes, time to live and replication but also offers amazing performance.

However, DynamoDB can become the most expensive service in your architecture easily as these features are not “cheap” to provide. That’s why it is very important to know how DynamoDB cost can be optimized based on your needs. Since the main cost in DynamoDB is writes and reads, the most important parameter to consider is the capacity mode. DynamoDB has 2 capacity modes namely On Demand and Provisioned modes.

On Demand Mode: This capacity mode is flexible and provides whatever capacity is needed by your application. Your application may need 100 write units one moment and then 10k write units the next; you pay only for what you use. In On Demand mode DynamoDB will try its best to respond to your needs and it does that really well by observing its behavior.

Provisioned Mode: In provisioned capacity mode, you have to decide how many read and write units you need and this will be provided to your table. If, however, your application tries to use more than the provisioned capacity, it will get throttled which means some of your requests will fail.

Of course the luxury of On Demand mode doesn’t come for free. Moving from On Demand mode to Provisioned mode can reduce your DynamoDB bill by up to %50 or even more in some cases! However, to be able to move to Provisioned mode you need to know your application’s behavior well and configure your provisioned capacity accordingly. Especially with tables that have Global Secondary Indexes (GSIs), this can be complicated because each GSI has its own capacity settings. Also, the capacity requirement can change over time.

Thankfully, DynamoDB has another feature called Autoscale which tries to move capacity up or down based on the usage. Nevertheless, Autoscale is not guaranteed to work as there are certain limitations on how many times the capacity can change in an hour and if the new required capacity is too large, it may take some time to provide it.

When should you use On Demand versus Provisioned mode?


On Demand mode is great for the following cases:

  • For tables that are not used or used rarely as you don’t pay anything if you don’t use it. It is therefore ideal for test tables.
  • If you don’t know how much capacity you need or if you have big spikes.
  • If you want to observe the behavior of an application. Therefore, even if you plan to move to Provisioned mode, it is good to start with On Demand mode first to see what capacity settings are required or whether it is possible at all to move to Provisioned mode.
  • If you want to “keep it simple” since you don’t need to worry about capacity settings, autoscale or throttles in On Demand mode.


Provisioned mode if ideal for the following cases:

  • If there is a consistent capacity requirement which means a capacity need that doesn’t keep changing massively and doesn’t have huge spikes.
  • If cost saving is required.


Lastly, if your application doesn’t require an enormous capacity constantly, there is no reason apart from cost saving to move from On Demand to Provisioned mode. Here “enormous” doesn’t mean a few thousands; On Demand mode can easily handle such a traffic. Having said that, cost is a great factor in most real cases!