Interview Prep/AWS/RDS, Aurora and DynamoDB

RDS status shows `storage-full` and writes fail.

IntermediateTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → FreeStorageSpace reached zero. Common reasons: growing tables, unvacuumed bloat, a large temp sort, binlogs or WAL kept by a stalled replication slot, or verbose logs.

Diagnose →

aws cloudwatch get-metric-statistics --namespace AWS/RDS --metric-name FreeStorageSpace \
  --dimensions Name=DBInstanceIdentifier,Value=mydb --statistics Minimum --period 300 \
  --start-time $(date -u -d '-1 day' +%FT%TZ) --end-time $(date -u +%FT%TZ)
psql -c "select slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) from pg_replication_slots;"

Fix →

  1. Add storage now: aws rds modify-db-instance --db-instance-identifier mydb --allocated-storage 500 --apply-immediately
  2. Drop stale replication slots, and vacuum or clean up data
  3. Turn on storage autoscaling: --max-allocated-storage 1000

Prevent → Alarm on FreeStorageSpace below 20%, turn on autoscaling, and alarm on OldestReplicationSlotLag / TransactionLogsDiskUsage.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB