Amazon ElastiCache for Redis (ELASTICACHE)
Acts as a high-performance in-memory caching layer in front of relational databases (RDS/Aurora) or NoSQL stores to offload read pressure, manage distributed sessions, and power real-time leaderboards.
AWS Container Placement
SUBNET
Summary
Ultra-fast in-memory caching and data store service delivering sub-millisecond response times for session management, caching, and streaming.
When to Use (SAA-C03)
Use Redis for leaderboards, sorted sets, Multi-AZ replication, and persistence; use Memcached for simple multi-threaded object caching.
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| EC2 | TCP | 6379 (Redis), 11211 (Memcached) | Application servers executing cache GET/SET operations, pub/sub messages, and session token lookups |
| ECS | TCP | 6379 | Containerized Fargate tasks connecting to Redis cluster endpoint for distributed caching |
| LAMBDA | TCP | 6379 | VPC-enabled Lambda functions accessing cache cluster via private subnet ENIs |
| ALB | TCP (indirect) | 6379 | Not directly reachable from ALB; ALB forwards to app compute which queries ElastiCache |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| ELASTICACHE-REPLICA | TCP (Replication) | 6379 | Asynchronous replication stream between primary master node and read replica nodes across AZs |
| S3 | HTTPS | 443 | Automated and manual daily RDB snapshot backups exported to Amazon S3 |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| Cluster Identifier (clusterId) (Required) | app-cache-prod | The unique identifier for the ElastiCache cluster or replication group in the AWS account and region. Why: Used to generate primary endpoint DNS names (e.g. cluster-id.xxxxxx.0001.use1.cache.amazonaws.com). |
| Cache Engine (engine) (Required) | redis | The caching engine software. Redis/Valkey provides data persistence, replication, transactions, and complex datatypes; Memcached is pure volatile key-value. Why: Determines supported protocols, clustering architecture, replication topology, and client libraries. |
| Node Type (nodeType) (Required) | cache.t3.micro | Specifies dedicated memory, vCPU, and network throughput allocation for each cache node. Why: ElastiCache is RAM-constrained: datasets must fit in memory. Node type dictates maximum capacity and memory eviction behavior. |
| Number of Nodes (numCacheNodes) (Required) | 2 | The count of cache nodes in the cluster. For Redis replication groups: 1 primary + N read replicas. Why: Determines read scalability and high availability: Multi-AZ requires at least 2 nodes in different AZs. |
| Port (port) (Required) | 6379 | The TCP network port on which the cache daemon listens for incoming client connections. Why: Must be opened on attached Security Groups to permit traffic from application compute subnets. |
| In-Transit Encryption (transitEncryptionEnabled) (Required) | true | Enables TLS 1.2+ encryption for all network traffic between application clients and ElastiCache nodes, as well as inter-node replication. Why: Mandatory for HIPAA, PCI-DSS, and SOC 2 security compliance to protect sensitive tokens and cached PII in transit. |
| Cache Subnet Group (cacheSubnetGroupName) | prod-redis-subnet-group | Collection of VPC subnets across multiple AZs designated for cache node IP assignment. Why: Allows ElastiCache to place read replicas in alternate AZs for automatic failover. |
| Automatic Failover (automaticFailoverEnabled) | true | Automatically promotes a read replica to primary if the primary node or AZ experiences a failure (< 60 seconds). Why: Eliminates downtime for write traffic during hardware disruptions without changing client endpoint DNS. |
| At-Rest Encryption (atRestEncryptionEnabled) | true | Encrypts cached data on disk, sync files, and backup snapshots using AWS KMS. Why: Protects in-flight persistence dumps and swap memory from physical extraction. |
| Redis AUTH Token (authSecretToken) | MySecretTokenPassword123! | Requires connecting clients to provide a password token (AUTH) or IAM identity before executing Redis commands. Why: Prevents unauthorized command execution if network boundaries are accidentally misconfigured. |
| Snapshot Retention Limit (snapshotRetentionLimit) | 7 | Number of days for which automated daily Redis RDB snapshots are retained in Amazon S3. Why: Allows point-in-time cluster restoration following fatal application corruptions. |
Practice Labs Using Amazon ElastiCache for Redis
Frequently Asked Questions
Where does Amazon ElastiCache for Redis live inside an AWS VPC architecture?
Valid container placement: SUBNET. Acts as a high-performance in-memory caching layer in front of relational databases (RDS/Aurora) or NoSQL stores to offload read pressure, manage distributed sessions, and power real-time leaderboards.
When should I use Amazon ElastiCache for Redis on the AWS SAA-C03 exam?
Use Redis for leaderboards, sorted sets, Multi-AZ replication, and persistence; use Memcached for simple multi-threaded object caching.
Can I simulate Amazon ElastiCache for Redis packet routing without an AWS account?
Yes. CloudTracer simulates Amazon ElastiCache for Redis along with 53 AWS services directly in your browser and exports production Terraform HCL.