Amazon ElastiCache is a managed caching service compatible with both Redis and Memcached. When it comes to Redis, ElastiCache offers a fully managed platform that makes it easy to deploy, manage, and scale a high performance distributed in-memory data store cluster. These capabilities can significantly decrease the operational overhead in maintaining machines, software patching, monitoring, failure recovery, and backups.
Amazon ElastiCache is fully compatible with the usual Redis data structures, APIs, and clients, allowing your existing applications that already use Redis to start using ElastiCache without any code changes. It supports both Redis cluster and non-cluster modes, providing enhanced high availability and reliability, with automatic failover scenarios across availability zones.
With the support of online cluster resizing, ElastiCache makes it easy to scale in or out in order to adapt to changing system demands without any downtime. From a security and compliance point of view, AWS ElastiCache has built-in VPC support and offers encryption in-transit and at-rest capabilities, combined with the native Redis AUTH feature for authentication and authorization support.
Amazon ElastiCache is a Caching-as-a-Service from Amazon Web Services. AWS simplifies setting up, managing, and scaling a distributed in-memory cache environment in the cloud. It provides a high-performance, scalable, and cost-effective caching solution. AWS removes the complexity associated with deploying and managing a distributed cache environment.
From the Amazon ElastiCache documentation, we learn that ElastiCache has features to enhance reliability for critical production deployments, including:
Automatic detection and recovery from cache node failures.
Automatic failover (Multi-AZ) of a failed primary cluster to a read replica in Redis replication groups.
Flexible Availability Zone placement of nodes and clusters.
Amazon ElastiCache provides two caching engines, Memcached and Redis. You can move your existing Memcached or Redis caching implementation to Amazon ElastiCache effortlessly. Simply change the Memcached/Redis endpoints in your application.
Helps reduce load off of databases for read intensive workloads
Helps make your application stateless
AWS takes care of OS maintenance / patching, optimizations, setup, configuration, monitoring, failure recovery and backups
Using ElastiCache involves heavy application code changes
ElastiCache Engine Types:
Amazon ElastiCache for Redis:
Redis is a newer technology and often considered as a superset of Memcached. That means Redis offers more and performs better than Memcached.
Amazon ElastiCache for Redis is a blazing fast in-memory data store that provides sub-millisecond latency to power internet-scale real-time applications. Built on open-source Redis and compatible with the Redis APIs, ElastiCache for Redis works with your Redis clients and uses the open Redis data format to store your data. Your self-managed Redis applications can work seamlessly with ElastiCache for Redis without any code changes. ElastiCache for Redis combines the speed, simplicity, and versatility of open-source Redis with manageability, security, and scalability from Amazon to power the most demanding real-time applications in Gaming, Ad-Tech, E-Commerce, Healthcare, Financial Services, and IoT.
1) REDIS-COMPATIBLE: Redis is a widely adopted in-memory data store for use as a database, cache, message broker, queue, session store, and leaderboard. Amazon ElastiCache for Redis maintains compatibility with the open source Redis data formats, Redis APIs, and works with Redis clients
2) HIGHLY AVAILABLE AND RELIABLE: Amazon ElastiCache for Redis supports both Redis cluster and non-cluster modes and provides high availability via support for automatic failover by detecting primary node failures and promoting a replica to be primary with minimal impact. It allows for read availability for your application by supporting read replicas (across availability zones), to enable the reads to be served when the primary is busy with the increased workload. ElastiCache for Redis supports enhanced failover logic to allow for automatic failover in cases when majority of the primary nodes for Redis cluster mode are unavailable.
3) EASILY SCALABLE: With Amazon ElastiCache for Redis, you can start small and easily scale your Redis data as your application grows – all the way up to a cluster with 340 TB of in-memory data. It allows you to scale your Redis Cluster environment up to 500 nodes and 500 shards. It supports online cluster resizing to scale-out and scale-in your Redis clusters without downtime and adapts to changing demand. To scale read capacity, ElastiCache allows you to add up to five read replicas across multiple availability zones. To scale write capacity, ElastiCache supports Redis cluster mode which enables you to partition your write traffic across multiple primaries.
Amazon ElastiCache for Memcached:
Memcached is an open source, distributed, in-memory key-value store-caching system for small arbitrary data streams flowing from database calls, API calls, or page rendering. Memcached has long been the first choice of caching technology for users and developers around the world.
Amazon ElastiCache for Memcached is a Memcached-compatible in-memory key-value store service that can be used as a cache or a data store. It delivers the performance, ease-of-use, and simplicity of Memcached. ElastiCache for Memcached is fully managed, scalable, and secure – making it an ideal candidate for use cases where frequently accessed data must be in-memory. It is a popular choice for use cases such as Web, Mobile Apps, Gaming, Ad-Tech, and E-Commerce.
1) Caching: Amazon ElastiCache for Memcached is a great choice for implementing an in-memory cache to decrease access latency, increase throughput, and ease the load off your relational or NoSQL database. Amazon ElastiCache can serve frequently requested items at sub-millisecond response times, and enables you to easily scale for higher loads without growing the costlier backend database layer. Database query results caching, persistent session caching, and full-page caching are all popular examples of caching with ElastiCache for Memcached.
2) Session Store: Session stores are easy to create with Amazon ElastiCache for Memcached. Simply use the Memcached hash table, which can be distributed across multiple nodes. Scaling the session store is as easy as adding a node and updating the clients to take advantage of the new node
ElastiCache – Cache Security:
All caches in ElastiCache:
- Support SSL in flight encryption
- Do not support IAM authentication
- IAM policies on ElastiCache are only used for AWS API-level security
- You can set a “password/token” when you create a Redis cluster
- This is an extra level of security for your cache (on top of security groups)
- Supports SASL-based authentication (advanced)
ElastiCache for Solutions Architects:
Patterns for ElastiCache:
1) Lazy Loading: all the read data is cached, data can become stale in cache
2) Write Through: Adds or update data in the cache when written to a DB (no stale data)
3) Session Store: store temporary session data in a cache (using TTL features)
Amazon ElastiCache Benefits:
Extreme performance: Amazon ElastiCache works as an in-memory data store and cache to support the most demanding applications requiring sub-millisecond response times. By utilizing an end-to-end optimized stack running on customer dedicated nodes, Amazon ElastiCache provides secure, blazing fast performance.
Fully managed: You no longer need to perform management tasks such as hardware provisioning, software patching, setup, configuration, monitoring, failure recovery, and backups. ElastiCache continuously monitors your clusters to keep your workloads up and running so that you can focus on higher value application development.
Scalable: Amazon ElastiCache can scale-out, scale-in, and scale-up to meet fluctuating application demands. Write and memory scaling is supported with sharding. Replicas provide read scaling.
Amazon ElastiCache for Redis – Global Datastore:
Global Datastore in Amazon ElastiCache for Redis provides fully managed, fast, reliable and secure cross-region replication. With Global Datastore, you can write to your ElastiCache for Redis cluster in one region and have the data available to be read from two other cross-region replica clusters, thereby enabling low-latency reads and disaster recovery across regions.
You can setup a Global Datastore by starting with an existing cluster, or by creating a new cluster to be used as a primary. Creating Global Datastore takes just a few clicks in the AWS Management Console for ElastiCache, or can be automated by downloading the latest AWS SDK or CLI. Global Datastore is not yet supported on AWS CloudFormation.
1) Write locally, read globally: With Global Datastore, you can write to your ElastiCache for Redis cluster in one region and have the data available to be read from two other cross-region replica clusters to enable low-latency local reads. With typical cross-region replication latency of under 1 second, your applications enjoy quick data access across regions.
2) Secure: Global Datastore for Redis uses encryption in-transit for cross-region traffic to keep your data secure. Additionally, you can also encrypt your primary and secondary clusters using encryption at-rest to keep your data secured end-to-end. Each primary and secondary cluster can have a separate customer managed customer master key (CMK) in AWS Key Management Service (KMS) for encryption at rest.
3) Easy to set-up: Global Datastore eliminates the complexity and operational burden of deploying, managing and replicating data in clusters across regions. You can set-up a Global Datastore by starting with an existing cluster, or by creating a new cluster to be used as primary. Creating a Global Datastore for Redis creation takes just a few clicks in the Amazon AWS ElastiCache Management Console for ElastiCache, or can be automated by downloading the latest AWS SDK or CLI.
4) Cross-region disaster recovery: In the unlikely event of regional degradation, one of the cross-region replica clusters in the Global Datastore can be promoted to become the primary cluster with full read/write capabilities in less than 1 minute, allowing your applications to remain available.
5) Extreme performance: Leverage Redis’ sub-millisecond latency for local reads/writes in primary region and local reads in secondary regions.
6) One-click seamless configuration changes: Global Datastore allows you to easily scale or upgrade regional clusters and ensures that all participating clusters are identically configured. You can also easily add or remove regions from the Global Datastore, or promote a secondary region to become the primary. With any configuration change, Global Datastore ensures that cross-region replication is appropriately setup and all secondary clusters replicate data from the primary cluster.