DynamoDB, ElastiCache, Redshift and Other Database Operations: Capacity, Backups, Scaling and Monitoring
DynamoDB Operations
| Topic | What to know |
|---|---|
| Capacity modes | On-demand (pay per request, no planning, handles spikes) or Provisioned (set RCU/WCU, optionally auto scaling, cheaper for steady traffic). You can switch modes (limited times per day) |
| RCU / WCU | 1 RCU = one strongly consistent read/s up to 4 KB (two eventually consistent). 1 WCU = one write/s up to 1 KB. Transactions cost double |
| Partitions | Data is spread by partition key. A hot key causes throttling even if table capacity looks free. Pick high-cardinality keys |
| Throttling | ProvisionedThroughputExceededException, metrics ReadThrottleEvents, WriteThrottleEvents. SDKs retry with backoff. Fix: raise capacity, enable auto scaling, spread keys, use DAX or on-demand |
| Backups | On-demand backups (no impact, kept until deleted) and PITR (continuous, restore to any second in the last 35 days into a new table). Also AWS Backup |
| TTL | Automatically delete expired items (free, within about 48 hours). Item attribute holds epoch seconds |
| Global tables | Multi-Region multi-active replication, needs streams and consistent settings. Good for DR and local reads |
| DAX | In-memory cache for microsecond reads (eventually consistent reads only) |
| Streams | Ordered change log for 24 hours, feeding Lambda |
| Table classes | Standard or Standard-IA (cheaper storage for rarely read tables) |
| Export / import | Export to S3 (from PITR) with no read capacity use |
bash
aws dynamodb describe-table --table-name Orders --query 'Table.[TableStatus,BillingModeSummary,ProvisionedThroughput]'
aws dynamodb update-continuous-backups --table-name Orders --point-in-time-recovery-specification PointInTimeRecoveryEnabled=true
aws dynamodb restore-table-to-point-in-time --source-table-name Orders --target-table-name Orders-restore --use-latest-restorable-time
aws dynamodb update-time-to-live --table-name Sessions --time-to-live-specification Enabled=true,AttributeName=expires_at
aws application-autoscaling register-scalable-target --service-namespace dynamodb --resource-id table/Orders --scalable-dimension dynamodb:table:WriteCapacityUnits --min-capacity 5 --max-capacity 500
| DynamoDB metric | Meaning |
|---|---|
ConsumedReadCapacityUnits / ConsumedWriteCapacityUnits | Usage vs provisioned |
ThrottledRequests, ReadThrottleEvents, WriteThrottleEvents | Capacity or hot partition problems. Contributor Insights shows hot keys |
SuccessfulRequestLatency | Latency per operation |
SystemErrors (5xx), UserErrors (4xx) | Service or request problems |
ReplicationLatency | Global tables lag |
ElastiCache
| Engine | Features |
|---|---|
| Redis / Valkey | Persistence, replication, Multi-AZ with automatic failover, cluster mode (sharding), backups, pub/sub, data structures, encryption, AUTH/IAM |
| Memcached | Simple, multi-threaded, sharded, no persistence, no replication |
| MemoryDB | Redis-compatible durable primary database with multi-AZ transaction log |
- Place in private subnets, security group allows the cache port (6379 / 11211) only from the app. Enable in-transit encryption and at-rest encryption at creation
- Multi-AZ replication group with at least one replica gives automatic failover (about a minute). Use the primary and reader endpoints (cluster mode: configuration endpoint)
- Scaling: vertical (change node type), horizontal (add shards or replicas, online resharding), or Serverless option
- Backups: daily snapshots (retention up to 35 days) to S3 for Redis. Maintenance windows apply patches. Pick a version upgrade plan
| Metric | Interpretation and action |
|---|---|
CPUUtilization / EngineCPUUtilization | Redis is single-threaded for commands. Watch the engine CPU (above 90 percent: scale or shard) |
DatabaseMemoryUsagePercentage | Near 100 percent causes evictions or write failures |
Evictions | Keys removed to make space. Increase memory, set TTLs, review maxmemory-policy (allkeys-lru, volatile-ttl, noeviction) |
CurrConnections, NewConnections | Connection storms |
ReplicationLag | Replica delay |
CacheHits, CacheMisses | Hit ratio = hits divided by hits plus misses. Low means poor key design or TTL |
SwapUsage (Memcached) / FreeableMemory | Memory pressure |
Amazon Redshift
- Columnar data warehouse with a leader node and compute nodes (RA3 with managed storage, DC2). Redshift Serverless removes cluster sizing
- Resize: elastic resize (minutes, node count change) or classic resize (more flexible, longer read-only period). Concurrency Scaling adds capacity for queues
- Snapshots: automatic (every 8 hours or 5 GB changes, default 1 day retention up to 35) and manual. Cross-Region snapshot copy for DR. Restore creates a new cluster
- Workload management (WLM) or automatic WLM and query monitoring rules protect important queries
- Maintenance: regular
VACUUMandANALYZE(auto in most cases), distribution and sort keys, Advisor recommendations - Security: VPC, encryption (KMS/HSM), IAM roles for
COPYandUNLOAD, enhanced VPC routing, audit logging to S3, column and row security - Metrics:
CPUUtilization,PercentageDiskSpaceUsed,DatabaseConnections,QueryDuration,WLMQueueLength,HealthStatus
bash
aws redshift describe-clusters --query 'Clusters[].[ClusterIdentifier,ClusterStatus,NumberOfNodes]'
aws redshift resize-cluster --cluster-identifier dw --number-of-nodes 6 --classic false
aws redshift create-cluster-snapshot --cluster-identifier dw --snapshot-identifier dw-pre-load
aws redshift enable-snapshot-copy --cluster-identifier dw --destination-region ap-southeast-1 --retention-period 7
Other Database Services at a Glance
| Service | Operations notes |
|---|---|
| DocumentDB | MongoDB-compatible. Cluster with replicas across 3 AZs, backups 1 to 35 days, TLS on by default, scale reads with replicas |
| Neptune | Graph database. Multi-AZ replicas, snapshots, encryption at creation |
| Keyspaces | Managed Cassandra, on-demand or provisioned |
| Timestream | Time-series, retention tiers memory and magnetic |
| QLDB (ledger) | Being retired. Prefer Aurora PostgreSQL with audit design |
| OpenSearch Service | Domain sizing, dedicated master nodes, UltraWarm, snapshots, watch ClusterStatus.red/yellow, FreeStorageSpace, JVM pressure |
Practice Tasks
- Create a table in on-demand mode, then switch to provisioned with auto scaling
- Enable PITR and restore to a new table
- Set up a Redis replication group with Multi-AZ and trigger a failover test
- Create alarms for
EvictionsandDatabaseMemoryUsagePercentage - Take a Redshift snapshot and enable cross-Region copy
Conclusion
DynamoDB: pick on-demand or provisioned plus auto scaling, avoid hot keys, enable PITR and TTL, watch throttle metrics. ElastiCache: use Multi-AZ replication, encryption, and watch memory, evictions and engine CPU. Redshift: use elastic resize, snapshots with cross-Region copy and WLM. Restores always create new resources.
Quick Summary: DynamoDB; ElastiCache; Redshift; other databases.

