Lesson 1 of 3 Amazon ElastiCache

Choosing ElastiCache Engines and Deployment Options

This lesson explains how the engine and deployment option of Amazon ElastiCache, a managed in-memory data store, determine what the cache can do and how it scales.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose between Valkey, Redis OSS and Memcached.
  • Choose between ElastiCache Serverless and node-based clusters.

Engines

ElastiCache supports three engines. Valkey, an open-source fork of Redis OSS backed by the Linux Foundation, is AWS's recommended engine and is priced lower than Redis OSS. Redis OSS is supported for existing workloads. Both offer rich data structures (strings, hashes, lists, sets, sorted sets, streams), replication, Multi-AZ automatic failover, snapshots and backups, encryption, authentication and pub/sub. Memcached is a simple, multithreaded key-value cache with no replication, no persistence and no failover; nodes are independent, and data on a failed node is lost. Choose Memcached only for a simple cache where losing data is acceptable and multithreaded scaling matters.

Sort into groups

Valkey or Memcached?

Exam skills 2.1.2

Choose the ElastiCache engine for each requirement.

Log in to try this activity Interactive activities are free with an account.

Serverless and node-based clusters

ElastiCache Serverless creates a cache without choosing node types or counts. It scales memory and compute automatically, replicates across multiple AZs, and charges for data stored and ElastiCache Processing Units consumed, with optional maximum limits. It is the least-effort option for variable workloads. Node-based clusters give full control of node types, shard and replica counts, maintenance windows and reserved node pricing.

For Valkey and Redis OSS node-based clusters, cluster mode disabled means one shard with one primary and up to five replicas, so all data must fit in one node's memory and writes scale only vertically. Cluster mode enabled partitions data across up to 500 shards, each with a primary and replicas, so both memory and write throughput scale horizontally, and shards can be added online. The following table summarises the options.

OptionScalingHigh availabilityUse when
Serverless (Valkey, Redis OSS, Memcached)AutomaticBuilt-in multi-AZVariable load, least management
Valkey/Redis OSS, cluster mode disabledScale up; add read replicasReplicas with Multi-AZ failoverDataset fits one node
Valkey/Redis OSS, cluster mode enabledAdd shards onlineReplicas per shard, Multi-AZLarge datasets or high write throughput
Memcached node-basedAdd or remove nodesNoneSimple multithreaded cache; data loss acceptable

The following diagram compares the two deployment options.

ElastiCache Serverless compared with node-based clusters. Serverless scales memory and compute automatically, replicates across AZs and charges for data stored and ElastiCache Processing Units. Node-based clusters give control of node types, shards, replicas, maintenance windows and reserved pricing.
Variable or unknown load points to Serverless; steady load with reserved pricing points to nodes.
Worked example

Choosing an engine

A team needs a session store for a web application and a leaderboard ranked by score, must survive the loss of a node or AZ without losing sessions, and wants minimal management. Memcached is ruled out by the need for sorted sets and failover. ElastiCache Serverless for Valkey meets every requirement: sorted sets for the leaderboard, multi-AZ replication and automatic scaling. A node-based Valkey cluster with cluster mode enabled would also work but requires capacity planning.

Check yourself

Does serverless ElastiCache need replication to be configured?

Show answer

No. It scales automatically and has built-in replication across Availability Zones.

Exam Tips

Remember for the exam

  • Valkey is AWS's recommended engine; Redis OSS remains supported.
  • Memcached has no replication, persistence or failover.
  • Serverless ElastiCache scales automatically with built-in multi-AZ replication.
  • Cluster mode enabled shards data to scale memory and writes horizontally.