0
0
DynamoDBquery~10 mins

Consistent vs eventually consistent reads in DynamoDB - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to perform a strongly consistent read in DynamoDB.

DynamoDB
response = table.get_item(Key={'id': '123'}, ConsistentRead=[1])
Drag options to blanks, or click blank then click option'
ATrue
BFalse
C'True'
D'False'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string 'True' instead of boolean True
Setting ConsistentRead to False expecting strong consistency
2fill in blank
medium

Complete the code to perform an eventually consistent read in DynamoDB.

DynamoDB
response = table.get_item(Key={'id': '456'}, ConsistentRead=[1])
Drag options to blanks, or click blank then click option'
A'False'
BFalse
C'True'
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using string 'False' instead of boolean False
Setting ConsistentRead to True expecting eventual consistency
3fill in blank
hard

Fix the error in the code to correctly request a consistent read.

DynamoDB
response = table.get_item(Key={'id': '789'}, ConsistentRead=[1])
Drag options to blanks, or click blank then click option'
A'true'
B'False'
CTrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or string values for ConsistentRead
Confusing string and boolean types
4fill in blank
hard

Fill both blanks to perform a query with a consistent read.

DynamoDB
response = table.query(KeyConditionExpression=Key('userId').eq('user123'), [1]=[2])
Drag options to blanks, or click blank then click option'
AConsistentRead
BFilterExpression
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using FilterExpression instead of ConsistentRead for consistency
Setting ConsistentRead to False expecting strong consistency
5fill in blank
hard

Fill all three blanks to create a strongly consistent scan with a filter expression.

DynamoDB
response = table.scan([1]=[2], [3]=Attr('status').eq('active'))
Drag options to blanks, or click blank then click option'
AConsistentRead
BTrue
CFilterExpression
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up FilterExpression and ConsistentRead parameters
Using False instead of True for ConsistentRead