AWS Database Services — RDS, DynamoDB, ElastiCache
Amazon RDS (Relational Database Service)
Section titled “Amazon RDS (Relational Database Service)”Managed Database Service: Simplifies setup, operation, and scaling of relational databases. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and Amazon Aurora.
Key Features:
- Multi-AZ deployments for high availability and automatic failover
- Read replicas for read performance and scalability
- Automated daily backups, snapshots, and point-in-time recovery
- VPC isolation, encryption at rest/in transit, IAM-based access control
- CloudWatch monitoring and Performance Insights for detailed analysis
Amazon Aurora
Section titled “Amazon Aurora”High-performance, fully managed relational database compatible with MySQL and PostgreSQL. Automatically replicates across three Availability Zones with continuous backup to S3.
Key Features:
- 5x throughput of standard MySQL, 3x of PostgreSQL
- Automatic failover and continuous backup
- Serverless option scales automatically based on application needs
- Global Databases span multiple AWS regions
Amazon DynamoDB
Section titled “Amazon DynamoDB”Fully managed NoSQL key-value and document database. Tables store items with attributes. Single-digit millisecond response times at any scale.
Partition Key Design:
Choose partition keys with high cardinality and uniform access distribution. DynamoDB distributes items across partitions—uneven access causes hot partitions and throttling.
Global Secondary Indexes (GSI) & Local Secondary Indexes (LSI):
Enable flexible querying beyond the partition key. GSI can be created/deleted post-table creation; LSI is fixed at table creation with 10 GB size limit.
DynamoDB Streams:
Capture item-level changes (INSERT, MODIFY, REMOVE) in real-time. Often paired with Lambda for event-driven processing.
DAX (DynamoDB Accelerator):
In-memory cache layer providing microsecond latencies for read-heavy workloads. Sits between application and DynamoDB table.
Amazon ElastiCache
Section titled “Amazon ElastiCache”Fully managed in-memory data store using Redis or Memcached. Sub-millisecond response times ideal for caching, session management, and real-time analytics.
Redis vs Memcached:
| Feature | Redis | Memcached |
|---|---|---|
| Persistence | Yes (RDB, AOF) | No (in-memory only) |
| Pub/Sub | Yes | No |
| Sorted Sets | Yes | No |
| Replication | Multi-AZ automatic failover | Simple replication |
| Multi-threading | Single-threaded | Multi-threaded |
| Use Case | Complex operations, durability | Simple caching, ultra-high throughput |
High Availability:
Redis supports Multi-AZ with automatic failover. Memcached requires manual setup. Choose Redis for HA needs.
Amazon MemoryDB for Redis
Section titled “Amazon MemoryDB for Redis”Fully managed Redis-compatible database designed for high throughput and low latency with built-in durability.
Key Features:
- Data replicated across multiple nodes and backed up to disk
- Multi-AZ replication with automatic failover
- Encryption at rest/in transit, VPC isolation, IAM integration
- Scales read/write capacity independently
Best Practices Summary
Section titled “Best Practices Summary”High Availability: Multi-AZ deployments for synchronous standby failover. Read replicas for read scalability (asynchronous).
Scalability: DynamoDB on-demand mode for instant scaling. Aurora Serverless auto-scales compute. ElastiCache sharding for horizontal scaling.
Backup & Recovery: Automate backups and snapshots. Test point-in-time recovery regularly.
Security: Encrypt data at rest/in transit. Use IAM roles, VPC isolation. Rotate credentials.
Monitoring: CloudWatch metrics, RDS Performance Insights, DynamoDB throttle alarms.
Cost Management: Right-size instances, use Reserved Instances for long-term, monitor over-provisioning.