Interview Prep/AWS/RDS, Aurora and DynamoDB

A user updates a profile and immediately reloads, but the GSI query still returns the old value.

IntermediateTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → Global secondary indexes are updated asynchronously and only support eventually consistent reads. ConsistentRead=true is rejected on a GSI.

Diagnose →

aws dynamodb query --table-name users --index-name email-index \
  --key-condition-expression 'email=:e' --expression-attribute-values '{":e":{"S":"[email protected]"}}'
aws dynamodb get-item --table-name users --key '{"userId":{"S":"u-1"}}' --consistent-read

Fix →

  1. For read-after-write views, read from the base table by primary key with --consistent-read
  2. Or use an LSI (it supports strong consistency but must be created with the table)
  3. Or return the updated item to the client from the write response

Prevent → Decide consistency needs per access pattern during design, and watch OnlineIndexPercentageProgress and GSI throttles.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB