I skipped a few chapters on this as I specifically wanted to dive into some specific topics.
A more advanced look at this is done in a later section "Capacity Management".
There are two capacity modes:
An example of provisioned is that you can set a maximum RCU and WCU per second (eg. 10 RCU & 5 WCU would set those limits per second).
Capacity is also distributed uniformly across partitions.
You can also switch between both at any given time.
It's a SQL compatible query language.
DynamoDB uses a subset of PartiQL.
Be wary, looks to use some form of scanning.
There are two phases:
For the iterative process, you should also apply "sample data" and look at "design patterns" as part of the iterative process. Finally, you need to "ensure extensibility".
Some best practices:
This will look at the sharing patterns.
First, what is a hot partition?
In DynamoDB, a partition key that doesn't have a high cardinality can result in many requests targeting only a few partitions and resulting in a hot partition. A hot partition can cause throttling if the partition limits of 3000 RCU or 1000 WCU (or a combination of both) per second are exceeded.
How can we help with hot partitions through sharing?
CAT#ART
and SK CRYSTAL#201
could be adjusted to be CAT#ART#CRYSTAL
and SK 201
.hashFn(Item Subcategory)
.CAT#ART
might become SHARD1#CAT#ART
, and another might become SHARD2#CAT#ART
.CAT#ART_1
. To query, you would need batchGetItem
with specific suffixFrom
.(1) and (2) are more natural, with (3) and (4) being artificial.
You should look to use (1), (2) or (4) as preferential order.
My own thoughts:
DynamoDB transactions execute multiple all-or-nothing actions within & across tables. Across tables is important (can only be done as long as tables are within the same region).
The cost is two phase, so the costs are double of a standard write. This is the same for reads.
The APIs used are TransactWriteItems
and TransactGetItems
.
Why use them? Depends on the use cases.
For business:
For technical reasons:
For best practices:
Please note: there are other limitations around this as well.