AWS Dynamo DB Power Notes
AWS Dynamo DB Power Notes
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 makes it a great fit for mobile, web, gaming, ad-tech, IOT, and
many other applications.
Because of its availability in three geographically data centers, It consists of two different types of
consistency models:
It maintains consistency across all the copies of data which is usually reached within a second. If you read
a data from 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 lattest
update. This is the best model for Read performance.
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.
1. Provisioned mode
2. On-demand mode
1. 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 total number of read capacity units depends on the item size, and read consistency model.
Strongly Consistent model: Read Capacity Unit represents one strong 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.
The total number of write capacity unit depends on the item size.
DynamoDB will require additional write capacity units when 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.
2. On-Demand mode
DynamoDB on-demand mode has a flexible new billing option which is capable of serving thousands of
requests per second without any capacity planning.
On-Demand mode offers pay-per-request pricing for read and write 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 database is very
complex to forecast.