ElastiCache is an AWS managed in-memory caching service that supports two engines: Redis and Memcached. On the exam, you'll be asked to choose the right engine based on scenario requirements like persistence, multi-AZ, data structures, pub/sub, and backup needs. Understanding the specific feature differences between the two is critical for architectural decisions.
ElastiCache is a fully managed in-memory data store service that improves application performance by retrieving data from fast, managed, in-memory caches instead of slower disk-based databases. It supports two open-source caching engines: Redis and Memcached.
Key facts:
Redis is an advanced in-memory key-value store that supports complex data structures, persistence, replication, and high availability through Multi-AZ deployments with automatic failover.
Key facts:
Memcached is a simple, high-performance, distributed memory object caching system designed for simplicity and horizontal scalability through multi-threaded architecture.
Key facts:

Redis Cluster mode enables horizontal scaling by partitioning data across multiple shards (node groups), each with a primary node and optional replicas.
Key facts:
Both Redis and Memcached can serve as session stores for web applications, but Redis is preferred when session persistence or failover is required.
Key facts:
Redis sorted sets enable efficient leaderboard and ranking operations with sub-millisecond performance for adding, updating, and querying ranked data.
Key facts:
Redis pub/sub enables real-time message broadcasting to multiple subscribers, useful for chat applications, notifications, and event-driven architectures.
Key facts:
Redis supports automated and manual snapshots for backup and restore, enabling disaster recovery and cloning environments.
Key facts:
Both engines support horizontal scaling, but the mechanisms and limitations differ significantly.
Redis scaling:
Memcached scaling:
Both engines support encryption in transit, but only Redis supports encryption at rest.
Key facts:
1. Scenario: An application requires a caching layer with automatic failover and Multi-AZ support to ensure high availability. Which ElastiCache engine should be used?
Correct Approach: Choose Redis because it supports Multi-AZ with automatic failover for high availability. Memcached does not provide failover or replication.
Check first: Does the scenario mention "high availability," "automatic failover," or "Multi-AZ"? These keywords directly indicate Redis.
Do NOT do first: Do not choose Memcached just because the scenario mentions "simple caching." High availability requirements always override simplicity.
Why other options are wrong: Memcached lacks replication and failover capabilities, making it unsuitable for HA requirements. DynamoDB DAX is for DynamoDB acceleration, not general caching. CloudFront is a CDN, not an in-memory cache.
2. Scenario: A gaming application needs to maintain a real-time leaderboard with frequent score updates and queries for top 100 players. Which ElastiCache engine is most appropriate?
Correct Approach: Choose Redis because sorted sets efficiently handle leaderboard operations with sub-millisecond performance.
Check first: Does the use case require complex data structures like sorted sets, lists, or ranking? This is a Redis-only feature.
Do NOT do first: Do not choose Memcached thinking horizontal scaling alone solves the problem. Memcached only supports simple key-value pairs and cannot efficiently implement leaderboards.
Why other options are wrong: Memcached lacks sorted data structures needed for ranking. RDS or DynamoDB could work but would be much slower than Redis sorted sets. Exam expects you to choose the optimal solution.
3. Scenario: A company wants to cache database query results and needs the simplest solution with the best multi-threaded performance. Data loss on node failure is acceptable. Which engine should be chosen?
Correct Approach: Choose Memcached because it offers multi-threaded architecture for better CPU utilization, and persistence is not required.
Check first: Does the scenario explicitly state that data loss is acceptable or that persistence is not required? This is the key indicator for Memcached.
Do NOT do first: Do not default to Redis just because it has more features. Memcached is simpler and more efficient for basic caching when persistence is not needed.
Why other options are wrong: Redis would add unnecessary complexity and cost when persistence and advanced features are not required. The scenario explicitly allows data loss, making Redis's persistence features irrelevant.
4. Scenario: An application requires encryption at rest for cached sensitive data to meet compliance requirements. Which ElastiCache engine must be used?
Correct Approach: Choose Redis because it is the only ElastiCache engine that supports encryption at rest.
Check first: Does the scenario mention "encryption at rest" or compliance requirements around data-at-rest security? This eliminates Memcached immediately.
Do NOT do first: Do not assume both engines support encryption at rest because both support encryption in transit. Only Redis supports encryption at rest.
Why other options are wrong: Memcached only supports encryption in transit, not at rest. Other caching solutions like CloudFront or DynamoDB DAX serve different purposes and don't meet the general caching requirement.
5. Scenario: A web application needs to store user sessions in a distributed cache. Sessions must survive cache node failures. Which solution is appropriate?
Correct Approach: Choose Redis with Multi-AZ and replication enabled to ensure session persistence and automatic failover on node failure.
Check first: Does the scenario require session persistence or survival across failures? This indicates a need for replication and persistence.
Do NOT do first: Do not choose Memcached for session storage if sessions must survive failures. Memcached does not replicate data, so sessions are lost on node failure.
Why other options are wrong: Memcached loses all data on node failure, violating the requirement. Storing sessions in RDS or DynamoDB would work but introduce higher latency compared to ElastiCache Redis.
Task: Selecting the correct ElastiCache engine based on scenario requirements
Task: Configuring Redis for high availability
Q1: A company is building a web application that requires storing user session data with sub-millisecond latency. The sessions must persist even if a cache node fails. Which ElastiCache configuration should be used?
(a) Memcached with multiple nodes for horizontal scaling
(b) Redis with Multi-AZ enabled and at least one read replica
(c) Redis Cluster mode enabled with no replicas
(d) Memcached with Auto Discovery enabled
Ans: (b)
Redis with Multi-AZ enabled and at least one read replica ensures session persistence and automatic failover on node failure. Option (a) Memcached loses all data on node failure. Option (c) Redis without replicas does not provide failover capability. Option (d) Memcached Auto Discovery helps with node identification but does not provide data persistence.
Q2: An online gaming platform needs to implement a leaderboard that updates player scores in real-time and retrieves the top 100 players with minimal latency. Which AWS service and feature should be used?
(a) DynamoDB with a Global Secondary Index sorted by score
(b) Redis ElastiCache with sorted sets
(c) Memcached ElastiCache with horizontal partitioning
(d) RDS MySQL with an indexed score column
Ans: (b)
Redis sorted sets are specifically designed for ranking and leaderboard use cases with O(log(N)) complexity for updates and queries, providing sub-millisecond performance. Option (a) DynamoDB GSI would work but with higher latency than Redis. Option (c) Memcached cannot implement sorted rankings with simple key-value pairs. Option (d) RDS would have much higher latency than in-memory Redis.
Q3: A compliance requirement mandates that all cached data must be encrypted at rest. The application also needs automatic failover for high availability. Which ElastiCache engine must be selected?
(a) Memcached with encryption in transit enabled
(b) Redis with encryption at rest and Multi-AZ enabled
(c) Either Redis or Memcached with appropriate encryption settings
(d) Memcached with SASL authentication
Ans: (b)
Only Redis supports encryption at rest, which is required by the compliance mandate. Multi-AZ provides the needed automatic failover. Option (a) Memcached does not support encryption at rest. Option (c) is incorrect because Memcached cannot meet the encryption at rest requirement. Option (d) SASL provides authentication, not encryption at rest.
Q4: An application requires a simple caching layer for database query results. The architecture must maximize throughput on multi-core instances. Data loss during cache node failures is acceptable as data can be reloaded from the database. Which ElastiCache engine is most appropriate?
(a) Redis with cluster mode enabled
(b) Redis with cluster mode disabled and read replicas
(c) Memcached with multiple nodes
(d) Redis with Multi-AZ enabled
Ans: (c)
Memcached's multi-threaded architecture maximizes throughput on multi-core instances. Since data loss is acceptable and no persistence is required, Memcached is simpler and more efficient than Redis. Options (a), (b), and (d) all involve Redis, which adds unnecessary complexity and cost when persistence and failover are not required.
Q5: A solutions architect is designing a real-time chat application that needs to broadcast messages to all connected users. The messages do not need to be stored permanently. Which ElastiCache feature should be used?
(a) Memcached with client-side message distribution
(b) Redis pub/sub messaging
(c) Redis sorted sets
(d) Memcached with consistent hashing
Ans: (b)
Redis pub/sub is designed for real-time message broadcasting to multiple subscribers without persistence. Option (a) Memcached does not support pub/sub messaging natively. Option (c) Sorted sets are for ranking, not messaging. Option (d) Consistent hashing is for data distribution, not message broadcasting.
Q6: A company needs to scale its ElastiCache cluster to handle increased read traffic. The dataset must remain consistent across all nodes, and automatic failover is required. What is the correct approach?
(a) Use Memcached and add more nodes to the cluster
(b) Use Redis with cluster mode disabled and add read replicas
(c) Use Redis with cluster mode enabled and add more shards
(d) Use Memcached with Auto Discovery enabled
Ans: (b)
Redis with cluster mode disabled and read replicas provides read scaling while maintaining data consistency through replication, plus automatic failover with Multi-AZ. Option (a) Memcached does not replicate data or provide failover. Option (c) Adding shards partitions data, which is for scaling storage and writes, not just read scaling. Option (d) Memcached does not meet the failover requirement.