AWS DynamoDB

Satyanarayana Gaddamanugu
3 min readJul 4, 2021
  • Amazon DynamoDB is a fast and flexible NoSQL database service for all applications that require consistent single-digit millisecond latency at any scale. It is a fully managed database that supports both document and key-value data models.
  • Its flexible data model and performance make it a great fit for mobile, web, gaming, ad-tech, IoT, and many other applications. It is stored in SSD storage. It is spread across three geographical data centers.

Because of its availability in three geographically data centers, It consists of two different types of consistency models:

  • Eventual Consistent Reads
  • Strongly Consistent Reads

Eventual Consistent Reads

It maintains consistency across all the copies of data which is usually reached within a second. If you read data from the DynamoDB table, then the response would not reflect the most recently completed write operation, and if you repeat to read the data after a short period, then the response would be the latest update. This is the best model for Reading performance.

Strongly Consistent Reads

A strongly consistent read returns a result that reflects all writes that received a successful response prior to the read.

DynamoDB throughput capacity depends on the read/write capacity modes for performing read/write operation on tables.

There are two types of reading/write capacity modes:

  • Provisioned mode
  • On-demand mode

Provisioned mode

  • It defines the maximum amount of capacity that an application can use from a specified table.
  • In a provisioned mode, you need to specify the number of reads and writes per second required by the application.
  • If the limit of Provisioned mode throughput capacity is exceeded, then this leads to the request throttling.
  • A provisioned mode is good for applications that have predictable and consistent traffic

The Provisioned mode consists of two capacity units:

  • Read Capacity unit
  • Write Capacity unit

Read Capacity Unit

  • The total number of reading capacity units depends on the item size, and read consistency model.
  • Read Capacity unit represents two types of consistency models:
  • Strongly Consistent model: Read Capacity Unit represents one strongly consistent read per second for an item up to 4KB in size.
  • Eventually Consistent model: Read Capacity Unit represents two eventually consistent reads per second for an item up to 4KB in size.
  • DynamoDB will require additional read capacity units when an item size is greater than 4KB. For example, if the size of an item is 8KB, 2 read capacity units are required for strongly consistent read while 1 read capacity unit is required for eventually consistent read.

Write Capacity Unit

  • The total number of write capacity units depends on the item size.
  • Only 1 write capacity unit is required for an item up to size 1KB.
  • DynamoDB will require additional write capacity units when the size is greater than 1KB. For example, if an item size is 2KB, two write capacity units are required to perform 1 write per second.
  • For example, if you create a table with 20 write capacity units, then you can perform 20 writes per second for an item up to 1KB in size.

On-Demand mode

  • DynamoDB on-demand mode has a flexible new billing option that is capable of serving thousands of requests per second without any capacity planning.
  • On-Demand mode offers pay-per-request pricing for reading and writes requests so that you need to pay only for what you use, thus, making it easy to balance costs and performance.
  • In On-Demand mode, DynamoDb accommodates the customer’s workload instantly as the traffic level increases or decreases.
  • On-Demand mode supports all the DynamoDB features such as encryption, point-in-time recovery, etc except auto-scaling
  • If you do not perform any read/write, then you just need to pay for data storage only.
  • On-Demand mode is useful for those applications that have unpredictable traffic and the database is very complex to forecast.

--

--