0
0
DynamoDBquery~10 mins

Unprocessed items handling in DynamoDB - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Unprocessed items handling
Send Batch Write Request
Receive Response
Check for Unprocessed Items?
NoDone
Yes
Retry Unprocessed Items
Send Batch Write Request
This flow shows how DynamoDB batch write requests may return unprocessed items, which need to be retried until all are processed.
Execution Sample
DynamoDB
batchWrite({
  RequestItems: {
    'Table': [
      { PutRequest: { Item: { /* item attributes */ } } },
      { DeleteRequest: { Key: { /* key attributes */ } } }
    ]
  }
})
Send a batch write request to DynamoDB and handle any unprocessed items by retrying.
Execution Table
StepActionRequest Items SentResponse Unprocessed ItemsNext Action
1Send batch write request5 items2 items unprocessedRetry unprocessed items
2Retry batch write request2 items1 item unprocessedRetry unprocessed items
3Retry batch write request1 item0 items unprocessedDone - all processed
💡 All items processed when unprocessed items count is zero
Variable Tracker
VariableStartAfter 1After 2Final
UnprocessedItemsCount5210
Key Moments - 2 Insights
Why do some items remain unprocessed after the first batch write?
Because DynamoDB may throttle requests or have temporary capacity limits, causing some items to be returned as unprocessed (see execution_table step 1).
Do we stop retrying after the first retry?
No, we keep retrying unprocessed items until none remain, as shown in execution_table steps 2 and 3.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, how many items were unprocessed after the first batch write?
A1 item
B5 items
C2 items
D0 items
💡 Hint
Check the 'Response Unprocessed Items' column in step 1 of the execution_table.
At which step does the unprocessed items count become zero?
AStep 3
BStep 2
CStep 1
DNever
💡 Hint
Look at the 'UnprocessedItemsCount' variable in variable_tracker after each step.
If the first batch write had no unprocessed items, what would happen next?
ARetry unprocessed items
BFinish processing
CSend another batch write with same items
DThrow an error
💡 Hint
Refer to the concept_flow where 'No' from 'Check for Unprocessed Items?' leads to 'Done'.
Concept Snapshot
DynamoDB batch writes may return unprocessed items due to throttling.
Always check response for unprocessed items.
Retry only those unprocessed items until all succeed.
This ensures data consistency and reliability.
Full Transcript
When you send a batch write request to DynamoDB, it may not process all items immediately. Some items can be returned as unprocessed due to temporary limits. You must check the response for these unprocessed items. If there are any, retry sending only those items. Repeat this process until no unprocessed items remain. This way, you ensure all your data is written successfully.