Amazon ElastiCache for Redis

Learn about the ElastiCache for Redis, its deployment options, and comparison with ElastiCache for Memcached.

Redis is an in-memory data store that is a popular choice for fast-moving data and real-time applications like leaderboard sessions, chat messaging, and real-time data analytics. But deploying, monitoring, and scaling is a big challenge for Redis applications, and here the Amazon ElastiCache for Redis comes into play.

Press + to interact

Amazon ElastiCache for Redis is a fully managed, high-performance, scalable, and cost-effective service that handles all the management and configuration tasks without our intervention. It is Redis compatible, making it capable of running our existing Redis applications seamlessly. Because, the data is available in the memory, it delivers sub-milliseconds latency and high throughput.

ElastiCache for Redis vs. MemoryDB for Redis

ElastiCache for Redis is a service that caches the data in memory to enhance performance instead of bringing data from the primary data store or databases. It is a good solution for use cases where our data resides in another database, and we want to improve read and write performance without changing the original database. 

MemoryDB for Redis is a primary database, and it is best suited for the use cases where we want to build applications with a durable and fast primary database. 

Deployment options

ElastiCache for Redis supports two types of deployments: Serverless and Self-designed clusters. The serverless option simplifies the deployment and scaling of the cluster according to the application’s requirements. In comparison, the self-designed cluster gives more control over the settings and configurations of the cluster. We can provision nodes according to our requirements and enable/disable cluster mode. Enabling cluster mode allows replication across multiple shards to enhance availability and scalability. The diagram below shows a brief comparison between Serverless and Sef-designed clusters:

Press + to interact
Serverless vs. Self-designed cluster
Serverless vs. Self-designed cluster

Use cases

Here are some of the use cases that can be a good example of Amazon ElastiCache for Redis:

  • E-commerce: Online stores require maintaining customers’ sessions, their purchase history, or their activity, and this information should be reflected in real-time. There is no need to go to the database for every single request. ElastiCache for Redis can be used to cache the data.

  • Real-time analytics: We can create business intelligent dashboards to show analytics using real-time data.

  • Gaming: Leaderboards can be created using ElastiCache for Redis to show the points or standings of the players all over the world.

Backup and restore

Amazon ElastiCache for Redis allows automatic backups daily that can be retained for the specified retention period (1–35 days). After the retention period, this type of backup is automatically deleted. Backups include the cluster’s metadata and all the cached data. Automatic backups can be scheduled as per our convenience, if not, ElastiCache automatically sets a window for backup. 

We can also take manual snapshots of the cache and retain them as long as we want. Data can be restored from both backups at any time by creating a new cluster from the backup. All backups are stored in Amazon S3 storage.

ElastiCache for Memcached

Amazon ElastiCache supports two in-memory database engines: Redis and Memcached. We’ve seen ElastiCache for Redis in detail now; let’s look at the main differences between these engines from ElastiCache’s perspective.

Redis

Memcached

Redis offers persistence and replication mechanism that’s why ElastiCache treats Redis more like a relational database.

Memcached is a pure caching engine with no persistence.

Clusters are managed as stateful entities like Amazon RDS.

Memcached nodes are managed as a pool like EC2 Auto Scaling Group.

Offers replication, high availability, and automatic failover

No replication is available in ElastiCache for Memcached nodes.

Supports Multi-AZ read replicas to enhance performance and failover process.

Multi-AZ is unavailable.

Get hands-on with 1300+ tech skills courses.