Notes based on Stéphane Maarek's Udemy course.
Traditional databases | NoSQL |
---|---|
Traditional applications leverage RDBMS databases | Non-relational, distributed databases |
SQL query language | Many different query languages, SQL can be one |
Strong requirements about how the data should be modelled | All the data should be present in one row |
Ability to do joins, aggregations and computations | Do not support join, can’t perform aggregations such as “SUM” |
Vertical scaling | Horizontal scaling |
If the items are larger than 1KB, more WCU is consumed
2 * 10 = 20 WCU
6 * 5 = 30 WCU (4.5 should be rounded to 5)
If the items are larger than 4KB, more RCU is consumed
10 * 4KB / 4KB = 10 RCU
(16 / 2) * (12 / 4) = 24 RCU
10 * 8KB / 4 = 20 RCU (we have to round up 6KB to 8 KB)
(TOTAL RCU / 3000) + (TOTAL WCU / 1000)
(TOTAL SIZE / 10GB)
CEILING(MAX(Capacity, Size))
aws dynamodb scan --table-name blog-posts --projection-expression "post_id, content" --region us-east-2
aws dynamodb scan --table-name blog-posts --projection-expression "post_id, content" --region us-east-2 --filter-expression "post_id = :p" --expression-attribute-values '{ \":p\" : { \"S\" : \"post-2\" }}'
aws dynamodb scan --table-name blog-posts --projection-expression "post_id, content" --region us-east-2 --page-size 10 --max-items 1
aws dynamodb scan --table-name blog-posts --projection-expression "post_id, content" --region us-east-2 --page-size 10 --max-items 1 --starting-token <token>