Database · AWS SERVICE CHEATSHEET

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.

Open Interactive ELASTICACHE Sandbox → Simulate in Architecture Studio

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 ServiceProtocolPortArchitectural Rationale
EC2TCP6379 (Redis), 11211 (Memcached)Application servers executing cache GET/SET operations, pub/sub messages, and session token lookups
ECSTCP6379Containerized Fargate tasks connecting to Redis cluster endpoint for distributed caching
LAMBDATCP6379VPC-enabled Lambda functions accessing cache cluster via private subnet ENIs
ALBTCP (indirect)6379Not directly reachable from ALB; ALB forwards to app compute which queries ElastiCache

Allowed Egress Targets & Ports

Target ServiceProtocolPortData Flow Rationale
ELASTICACHE-REPLICATCP (Replication)6379Asynchronous replication stream between primary master node and read replica nodes across AZs
S3HTTPS443Automated and manual daily RDB snapshot backups exported to Amazon S3

Key Configuration Parameters & AWS Best Practices

ParameterFormat / ExamplePurpose & Rationale
Cluster Identifier (clusterId) (Required)app-cache-prodThe 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)redisThe 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.microSpecifies 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)2The 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)6379The 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)trueEnables 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-groupCollection 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)trueAutomatically 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)trueEncrypts 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)7Number 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

BUILD-07

Build: Sub-Millisecond Caching Tier for High-Read Database

Build an architecture where an Application Load Balancer distributes to EC2 instances, and the EC2 instances c…

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.

More Database Cheatsheets

RDS Database → DynamoDB NoSQL →