0
0
DynamoDBquery~10 mins

Item size limits and considerations in DynamoDB - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Item size limits and considerations
Start: Create/Update Item
Calculate Item Size
Is size <= 400 KB?
NoReject Item: Too Large
Yes
Store Item in Table
Item Stored Successfully
When adding or updating an item, DynamoDB calculates its size. If the size is more than 400 KB, the item is rejected. Otherwise, it is stored successfully.
Execution Sample
DynamoDB
PutItem {"id": "123", "data": "...large string..."}
Calculate size of item
If size > 400 KB reject
Else store item
This simulates adding an item and checking if its size is within the 400 KB limit before storing.
Execution Table
StepActionItem Size (KB)ConditionResult
1Receive item with id and dataN/AN/AProceed to size calculation
2Calculate item size350350 <= 400?Yes, proceed to store
3Store item in table350N/AItem stored successfully
4Receive item with id and dataN/AN/AProceed to size calculation
5Calculate item size450450 <= 400?No, reject item
6Reject item450N/AItem rejected due to size limit
💡 Execution stops when item size exceeds 400 KB and item is rejected.
Variable Tracker
VariableStartAfter Step 2After Step 3 or 6
item_size_kbN/A350350 (stored)
item_size_kbN/A450450 (rejected)
Key Moments - 2 Insights
Why is the item rejected even though it has valid data?
Because the item size exceeds 400 KB as shown in execution_table row 5, DynamoDB rejects it to enforce the size limit.
Does DynamoDB count only attribute values for size or the whole item?
DynamoDB counts the entire item size including attribute names and values, as implied in step 2 where total item size is calculated.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the item size at step 2 for the first item?
A400 KB
B350 KB
C450 KB
DN/A
💡 Hint
Check the 'Item Size (KB)' column at step 2 in the execution_table.
At which step does the item get rejected due to size?
AStep 6
BStep 5
CStep 3
DStep 2
💡 Hint
Look for the row where the result says 'Item rejected due to size limit' in execution_table.
If the item size was exactly 400 KB, what would happen according to the flow?
AItem would be rejected
BItem size is recalculated
CItem would be stored
DItem is partially stored
💡 Hint
Refer to the condition 'Is size <= 400 KB?' in concept_flow and execution_table step 2.
Concept Snapshot
DynamoDB items must be 400 KB or less in size.
Item size includes attribute names and values.
If item size > 400 KB, DynamoDB rejects the item.
Check item size before storing to avoid errors.
This limit applies to each individual item stored.
Full Transcript
When you add or update an item in DynamoDB, it calculates the total size of that item including all attribute names and values. If the size is more than 400 KB, DynamoDB will reject the item and not store it. If the size is 400 KB or less, the item is stored successfully. This ensures that items do not exceed the maximum allowed size. For example, if an item has a size of 350 KB, it will be stored. But if it has 450 KB, it will be rejected. Always check your item size before storing to avoid errors.