Interview Prep/AWS/RDS, Aurora and DynamoDB

One DynamoDB table throttles even though consumed capacity is far below provisioned (or it is on-demand).

AdvancedTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → A hot partition. One partition key, such as status=PENDING, today's date or one big tenant, takes most of the traffic. Each partition is limited to about 3,000 RCU and 1,000 WCU per second, no matter how much the table has.

Diagnose →

aws dynamodb describe-contributor-insights --table-name orders
aws dynamodb update-contributor-insights --table-name orders --contributor-insights-action ENABLE
# then view top partition keys in CloudWatch Contributor Insights

Fix →

  1. Redesign the key for higher cardinality, for example write-sharding the hot key: PENDING#<0-9>
  2. Cache hot reads with DAX or ElastiCache
  3. Spread time-series writes across shard suffixes

Prevent → Model access patterns before you build the table, and keep Contributor Insights on for important tables.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB