DynamoDB
Amazon DynamoDB is a fully managed proprietary NoSQL database service that supports key–value and document data structures.
Overview
Amazon DynamoDB has two read/write capacity modes for processing reads and writes on your tables:
- On-demand
- Provisioned (default, free-tier eligible)
On-demand
Amazon DynamoDB on-demand is a flexible billing option capable of serving thousands of requests per second without capacity planning. DynamoDB on-demand offers pay-per-request pricing for read and write requests so that you pay only for what you use.
Provisioned
If you choose provisioned mode, you specify the number of reads and writes per second that you require for your application. You can use auto scaling to adjust your table’s provisioned capacity automatically in response to traffic changes. This helps you govern your DynamoDB use to stay at or below a defined request rate in order to obtain cost predictability.
Provisioned mode is a good option if any of the following are true:
- You have predictable application traffic.
- You run applications whose traffic is consistent or ramps gradually.
- You can forecast capacity requirements to control costs.
For the POC I’ll go with provisioned until we can predict our cost.
| Charge Type | Price |
|---|---|
| Read request units (Provisioned) | $0.000147 per RCU |
| Write request units (Provisioned) | $0.000735 per WCU |
| Read request units (On-demand) | $0.283 per million read request units |
| Write request units (On-demand) | $1.4135 per million write request units |
| Data storage | - First 25 GB stored per month is free - $0.283 per GB-month thereafter |
WCU / RCU
One read capacity unit represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size.
One write capacity unit represents one write per second for an item up to 1 KB in size. If you need to write an item that is larger than 1 KB, DynamoDB must consume additional write capacity units.
Use case example
A provisioned table with 6 read capacity units and 6 write capacity units. With these settings, your application could do the following:
- Perform strongly consistent reads of up to 24 KB per second (4 KB × 6 read capacity units).
- Perform eventually consistent reads of up to 48 KB per second (twice as much read throughput).
- Perform transactional read requests of up to 12 KB per second.
- Write up to 6 KB per second (1 KB × 6 write capacity units).
- Perform transactional write requests of up to 3 KB per second.
Resources
- https://www.alexdebrie.com/posts/dynamodb-single-table/
- Using Global Secondary Indexes in DynamoDB - Amazon DynamoDB
- Read/Write Capacity Mode - Amazon DynamoDB