Amazon ElastiCache
Cloud service · AWS · Updated

Amazon ElastiCache

In short

Amazon ElastiCache is a fully managed in-memory caching service that helps improve the performance of web applications by allowing you to retrieve information from fast, managed, in-memory caches, instead of relying solely on slower disk-based databases.

Cloud Services Hub →

9 key features of Amazon ElastiCache

Amazon ElastiCache offers a fully managed in-memory caching service with high performance, scalability, high availability, security features, and seamless integration with AWS services, ensuring ease of use and cost-effectiveness.

01
In-Memory Caching

Amazon ElastiCache offers fully managed in-memory data stores, support for Valkey, Redis OSS, and Memcached, allowing for high-performance, scalable, and cost-effective caching solutions.

02
High Performance

ElastiCache is designed for high throughput and low latency workloads, providing fast access to datasets by storing them in-memory, leading to improved application performance.

03
Scalability

With the ability to automatically scale the cache cluster horizontally and vertically, ElastiCache ensures that your caching layer can grow with your application's demands.

04
High Availability

The service supports automatic failover, multi-AZ deployments for Redis, and replication across AWS Availability Zones to ensure that your caching layer is both resilient and reliable.

05
Secure

ElastiCache includes security features such as encryption in-transit and at-rest, VPC support, and compliance with various standards, protecting sensitive data and ensuring privacy.

06
Fully Managed Service

Amazon ElastiCache takes care of operational complexity, such as hardware provisioning, setup and configuration, monitoring, failure recovery, and software patching.

07
Cost-Effective

With on-demand pricing and reserved instance options, ElastiCache allows for cost savings and efficient resource utilization, adapting to your usage patterns.

08
Integrated with AWS Services

ElastiCache seamlessly integrates with other AWS services like Amazon CloudWatch for metrics, AWS CloudTrail for audit and compliance, and Amazon RDS for database layer caching.

09
Ease of Use

Through the AWS Management Console, CLI, and SDKs, ElastiCache is easy to deploy, manage, and scale, streamlining operations for developers and system administrators.

Where Amazon ElastiCache is used

Amazon ElastiCache is widely used for caching frequently accessed data, serving as a session store, supporting real-time analytics and leaderboards, and reducing database load by functioning as a database caching layer.

  1. 01
    Caching Frequently Accessed Data

    Amazon ElastiCache can be utilized to cache data that is frequently requested by users or applications. By keeping this information in memory, it allows for rapid data retrieval, drastically reducing latency and improving the performance of web applications that rely on this type of data.

  2. 02
    Session Store

    ElastiCache serves as an extremely efficient session store with its in-memory data storage capabilities. It can handle large volumes of sessions for web applications, providing quick access and scalability while ensuring session data is kept fast and responsive for the user's experience.

  3. 03
    Real-Time Analytics

    The service is perfect for scenarios involving real-time analytics. It can quickly process and analyze large volumes of data in real-time, enabling applications to offer insights and response capabilities with minimal delay, suited for use cases such as recommendation engines or fraud detection.

  4. 04
    Leaderboards and Counting

    Amazon ElastiCache excels at managing rapidly changing data like game leaderboards or hit counters. It can update and serve this data at high speed, essential for gaming platforms or websites that require real-time ranking or counting features.

  5. 05
    Database Caching

    To enhance the performance of backend databases, ElastiCache can be deployed as a front-end database caching layer. This helps in reducing the load on the databases by serving read-intensive queries from the cache, effectively minimizing the database read throughput and lowering latency.

How Amazon ElastiCache is priced

Amazon ElastiCache offers on-demand pricing based on hourly rates, reserved instance pricing for one or three-year commitments with discounted rates, and data transfer pricing that may apply for outbound data transfers.

On-Demand Pricing

Users pay an hourly rate for the ElastiCache node size and type they use, with no long-term commitments or up-front fees. Prices vary based on the node type and region, and charges accrue per hour for each node that is running.

Reserved Instance Pricing

Customers can reserve ElastiCache nodes for a one or three-year term and enjoy a significant discount compared to the on-demand price. The reservation involves an upfront payment, with options for partial or no upfront payment, and the hourly rate is lower than the on-demand rate.

Data Transfer Pricing

In-Region transfer is free for Serverless caches with VPC endpoints. For Serverless public endpoints and cross-AZ node-based access, the cache side is free, but application-side transfer costs $0.01 per GB. Across Regions, standard rates may apply to application traffic sent to a cache; application traffic received from the cache is free. Cache-side cross-Region application traffic is free for VPC-endpoint Serverless caches and node-based clusters, while public-endpoint caches incur standard rates for outgoing traffic. Global Datastore replication incurs charges for traffic leaving the primary Region. Standard internet egress rates apply, with 100 GB free monthly aggregated across AWS services and Regions except China and GovCloud.

Serverless Pricing

ElastiCache Serverless charges for data stored in GB-hours and requests measured in ElastiCache Processing Units (ECPUs), which account for CPU time and data transferred. Minimum metered storage is 100 MB per Valkey cache and 1 GB per Memcached or Redis OSS cache. Each search index incurs additional metered storage equal to 30% of the text or numeric data it covers and 10% of the vector data it covers.

Database Savings Plans

Database Savings Plans offer savings in exchange for a commitment to a specific amount of eligible usage, measured in dollars per hour, over a one-year term.

Durability Pricing

For node-based ElastiCache clusters, synchronous durability writes cost 18% above the standard node-hour price. Asynchronous durability writes have no additional charge beyond standard node-hour pricing.

Backup Storage Pricing

Backup storage costs $0.085 per GiB per month in all AWS Regions.

Extended Support Pricing

For provisioned ElastiCache for Redis OSS instances, Extended Support carries an 80% premium in years one and two and a 160% premium in year three. Pricing also depends on the AWS Region and calendar date.

Detailed Monitoring Pricing

ElastiCache does not charge extra for detailed monitoring, but CloudWatch bills selected metrics as OpenTelemetry metrics by ingested data volume. CloudWatch also charges for alarms and PromQL queries through its API or other tools, including those on core metrics; CloudWatch console queries and dashboards are free.

Services Amazon ElastiCache works with

Amazon EC2Amazon EC2

Amazon ElastiCache nodes are deployed within Amazon EC2 instances, and you can seamlessly connect your EC2 instances to your ElastiCache clusters for low-latency data access.

Amazon CloudWatchAmazon CloudWatch

Amazon CloudWatch provides detailed monitoring of ElastiCache performance metrics, helping you to set alarms and automated actions based on specified thresholds.

Amazon VPCAmazon VPC

Amazon ElastiCache allows you to launch clusters within your Amazon VPC, enabling you to isolate your cluster within a private network and extend your on-premises network to the cloud.

AWS CloudFormationAWS CloudFormation

AWS CloudFormation allows you to define and provision ElastiCache resources using templates, enabling infrastructure as code and repeatable deployments.

AWS LambdaAWS Lambda

AWS Lambda can be used to run code in response to ElastiCache events, such as cache misses or updates, enabling serverless application architectures.

Amazon AuroraAmazon Aurora

You can create an ElastiCache cache using an Aurora DB cluster's settings, reusing compatible network configuration to simplify connectivity. Applications remain responsible for populating and invalidating cached database results.

Amazon Aurora ServerlessAmazon Aurora Serverless

ElastiCache caches can be created using the settings of an Aurora Serverless DB cluster, simplifying configuration of their network connectivity. This does not automatically replicate database contents into the cache.

Amazon Data FirehoseAmazon Data Firehose

ElastiCache can deliver supported engine logs and slow logs to Amazon Data Firehose. A delivery stream can then send those logs to destinations such as Amazon S3 for retention and analysis.

Amazon DevOps GuruAmazon DevOps Guru

ElastiCache metrics can be analyzed by Amazon DevOps Guru to identify unusual operational behavior. Insights can help investigate problems such as abnormal memory pressure or elevated cache CPU utilization.

What is Amazon ElastiCache

4 min read

Amazon ElastiCache is a fully managed caching service provided by Amazon Web Services (AWS) that offers seamless deployment, operation, and scaling of in-memory cache environments in the cloud. The service improves the performance of web applications by allowing them to retrieve information from a fast, managed, in-memory caching system, instead of relying solely on slower disk-based databases. 

ElastiCache supports three open-source in-memory caching engines: Valkey, Redis OSS, and Memcached. With Redis, ElastiCache provides a feature-rich platform, suitable for use cases such as primary datastore for lightweight transactions, session stores, gaming leaderboards, and pub/sub messaging systems. 

Extended Support lets you continue running Redis OSS major versions after community end-of-life, with patches for critical security issues and bugs for up to three years while you prepare to upgrade.

Redis is well-known for its support of complex data structures such as sorted sets and lists, as well as its ability to support high-performance, atomic operations. This makes it ideal for scenarios requiring complex queries or transactional capabilities. ElastiCache for Redis offers various features such as replication across Availability Zones for increased availability, automatic failover to a read replica in case of primary node failure, and data persistence. 

With Valkey 9.0, ElastiCache also offers durability through a Multi-AZ transactional log for use as a persistent data store. It supports synchronous writes designed for zero data loss or asynchronous writes for microsecond write latency.

ElastiCache for Memcached, on the other hand, is designed for simplicity and is a great fit for straightforward caching scenarios that require a highly scalable, distributed memory object caching system. It is particularly effective at speeding up dynamic web applications by alleviating database load. 

Amazon ElastiCache is engineered to deliver sub-millisecond latency and high-throughput, which is essential for applications that require real-time access to information. It handles tasks like hardware provisioning, software patching, setup, configuration, and monitoring, which simplifies the management of in-memory cache environments. 

Besides performance, ElastiCache is also focused on security. It allows users to control access to their caches through AWS Identity and Access Management (IAM), supports encryption in-transit and at-rest for Redis, and is also compliant with HIPAA, PCI DSS, and other common compliance standards. 

ElastiCache Serverless for Valkey 9 or later supports either VPC or public endpoints. Public endpoints allow internet connections without a VPC and require IAM authentication and TLS for every connection.

Scalability is another significant advantage of using Amazon ElastiCache. Users can start with a small cache cluster and scale out to accommodate growing demands, with just a few clicks in the AWS Management Console or with a simple API call. This elasticity allows users to adapt to varying loads and traffic spikes without over-provisioning resources, which in turn can lead to cost-savings. 

ElastiCache offers serverless and node-based deployments. ElastiCache Serverless manages infrastructure and scales instantly with application demand without downtime during maintenance. Node-based deployments let you select node types and sizes for fine-grained control over configuration and resource allocation.

ElastiCache Serverless for Valkey supports vector, full-text, and hybrid search, along with aggregations.

ElastiCache Serverless runs its engines in cluster mode and requires clients that support TLS.

Node-based Valkey and Redis OSS deployments can use data tiering on R6gd nodes, combining memory with NVMe SSD storage for less frequently accessed data. Accessing data on SSD adds latency; data tiering is not supported for Memcached.

Amazon ElastiCache integrates seamlessly with other AWS services, such as Amazon EC2 for compute resources, Amazon S3 for backups and persistent storage, and Amazon CloudWatch for monitoring and alerting. This tight integration with the AWS ecosystem allows developers to build and run applications with high performance, availability, and security, without the operational complexity of managing a caching layer on their own. 

ElastiCache can also run on AWS Outposts, using M5 and R5 family nodes. ElastiCache Serverless is not available on Outposts.

For node-based Valkey clusters outside AWS Outposts, standard monitoring publishes classic CloudWatch metrics and core OpenTelemetry metrics every 60 seconds. Detailed monitoring lets you select OpenTelemetry metrics from the full set and publish them every 15 seconds.

Overall, Amazon ElastiCache is a powerful solution for developers looking to enhance the performance of their applications through efficient in-memory caching, without the hassle of managing the underlying infrastructure. Its flexibility, ease of use, and integration with AWS services make it a strong choice for enterprises and developers looking to build scalable, high-performance web applications.

Concepts related to Amazon ElastiCache

Amazon ElastiCache exam questions

Real practice exam questions on Amazon ElastiCache, with the correct answer and its explanation. Answer them with every option in the exam simulator.

CLF-C02

A company runs a reporting application on multiple application servers. Many users request the same dashboard summaries, causing the application to repeatedly run expensive queries against an Amazon RDS database. The summaries can be reused for five minutes before being refreshed. Which solution would BEST reduce database queries while providing low-latency access to the summaries?

Show answerCORRECT ANSWER

Use Amazon ElastiCache to store dashboard summaries in a shared in-memory cache with a five-minute expiration.

Amazon ElastiCache provides a managed in-memory cache. The application can reuse cached summaries across servers, reducing repeated database queries and providing low-latency reads. A five-minute expiration supports the stated refresh requirement.

MLA-C02

A company runs a conversational AI agent on multiple stateless application workers. Each turn can be handled by a different worker. The workers need a shared store for recent messages and temporary tool results, with submillisecond read latency under normal operating conditions. Session state must become unavailable after 30 minutes without activity, and each new turn must restart that inactivity period. The store must automatically promote a replica if its primary node fails. Losing a small amount of recent state during failover is acceptable because the application can reconstruct it from a durable audit log.

Which configuration best meets these requirements?

Show answerCORRECT ANSWER

Create an Amazon ElastiCache for Redis OSS replication group with Multi-AZ and automatic failover enabled. Store each session under its own key, use the primary endpoint, and refresh the key's 30-minute expiration on every turn.

ElastiCache for Redis OSS provides low-latency shared session storage. Refreshing the key expiration on every turn implements a sliding inactivity timeout, and expired keys are not returned to clients. Multi-AZ with automatic failover allows a replica to be promoted after primary failure. Asynchronous replication can lose recent updates during failover, which the scenario explicitly permits.

SAP-C03

An industrial equipment company runs a reference-data API backed by Amazon Aurora PostgreSQL and an Amazon ElastiCache for Memcached cluster. The database contains specifications for millions of equipment models, but customers request only a small subset. Separate administrative applications update specifications directly in Aurora. Cached specifications can be stale for approximately 60 seconds, but frequently requested specifications must not remain stale indefinitely.

During a maintenance exercise, an empty node replaces a cache node. The API currently returns errors for records that were on the replaced node, even though those records remain available in Aurora. The company requires requests to continue succeeding during cache recovery without waiting for a bulk reload. Recovery must populate the cache only with requested records and restore low-latency access for repeatedly requested records, including records that are never updated. Load testing confirms that Aurora can support the temporary increase in reads during recovery.

Which application design meets these requirements?

Show answerCORRECT ANSWER

Read from Memcached first. On a miss, retrieve the record from Aurora, return it, and attempt to cache it with a 60-second TTL. Do not extend the TTL on cache hits. If a cache operation fails, serve the database result without requiring the cache write to succeed.

This design populates the cache on demand. An empty replacement node causes database reads and temporarily higher latency, rather than application errors. Requested records are cached again, including records that never change. A TTL that is not renewed on hits prevents popular entries from remaining cached indefinitely, and cache write failures do not make the authoritative database unavailable.

Practice Amazon ElastiCache in a full exam

Questions on Amazon ElastiCache in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Amazon ElastiCache in lessons

13 short lessons on Amazon ElastiCache in 7 certification courses.

and 7 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.