# Amazon ElastiCache

Cloud service · AWS. Updated 2026-11-12. Page: https://blowstack.com/tools/cloud-services-hub/amazon-elasticache

> 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.

Practice exams covering Amazon ElastiCache: [CLF-C02 AWS Certified Cloud Practitioner](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [MLA-C02 AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 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.

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **Fully Managed Service**: Amazon ElastiCache takes care of operational complexity, such as hardware provisioning, setup and configuration, monitoring, failure recovery, and software patching.
7. **Cost-Effective**: With on-demand pricing and reserved instance options, ElastiCache allows for cost savings and efficient resource utilization, adapting to your usage patterns.
8. **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.
9. **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. **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. **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. **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. **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. **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 EC2](https://blowstack.com/tools/cloud-services-hub/amazon-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 CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-cloudwatch)**: Amazon CloudWatch provides detailed monitoring of ElastiCache performance metrics, helping you to set alarms and automated actions based on specified thresholds.
- **[AWS Identity and Access Management (IAM)](https://blowstack.com/tools/cloud-services-hub/aws-identity-and-access-management-(iam))**: AWS IAM is used to manage access and permissions for ElastiCache resources, allowing you to control who can create, modify, or delete your ElastiCache resources.
- **[Amazon VPC](https://blowstack.com/tools/cloud-services-hub/amazon-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 CloudFormation](https://blowstack.com/tools/cloud-services-hub/aws-cloudformation)**: AWS CloudFormation allows you to define and provision ElastiCache resources using templates, enabling infrastructure as code and repeatable deployments.
- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-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 Aurora](https://blowstack.com/tools/cloud-services-hub/amazon-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 Serverless](https://blowstack.com/tools/cloud-services-hub/amazon-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 Firehose](https://blowstack.com/tools/cloud-services-hub/amazon-kinesis-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 Guru](https://blowstack.com/tools/cloud-services-hub/amazon-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.
- **[Amazon EventBridge](https://blowstack.com/tools/cloud-services-hub/amazon-eventbridge)**: ElastiCache management API calls recorded by CloudTrail can match EventBridge rules. For example, a rule can initiate a workflow when a replication group is deleted or its configuration changes.
- **[Amazon MemoryDB for Redis](https://blowstack.com/tools/cloud-services-hub/amazon-memorydb-for-redis)**: ElastiCache Redis OSS data can be migrated to Amazon MemoryDB for Redis using an RDB snapshot exported to Amazon S3. MemoryDB imports the snapshot when creating the destination cluster.
- **[Amazon RDS](https://blowstack.com/tools/cloud-services-hub/amazon-rds)**: ElastiCache caches can be created using an Amazon RDS database's settings, simplifying network configuration for applications that use both resources. Applications explicitly manage which database results are cached and when they expire.
- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: ElastiCache can export supported Valkey and Redis OSS backups to an S3 bucket and use RDB files in S3 to seed a cache. This supports retaining backup copies and migrating existing datasets into ElastiCache.
- **[Amazon Simple Notification Service (Amazon SNS)](https://blowstack.com/tools/cloud-services-hub/amazon-simple-notification-service-(amazon-sns))**: ElastiCache can publish cluster event notifications to an SNS topic. Subscribers can receive notifications about events such as node replacement, recovery, or configuration changes.
- **[AWS Auto Scaling](https://blowstack.com/tools/cloud-services-hub/aws-auto-scaling)**: ElastiCache integrates with Application Auto Scaling to adjust supported cache capacity using target-tracking policies or scheduled actions. For example, a Valkey replication group can add shards or replicas as demand increases.
- **[AWS CloudTrail](https://blowstack.com/tools/cloud-services-hub/aws-cloudtrail)**: ElastiCache management API activity is recorded by CloudTrail, including the caller, request parameters, and time of the operation. These records help audit changes such as cache creation, deletion, and security configuration updates.
- **[AWS Config](https://blowstack.com/tools/cloud-services-hub/aws-config)**: AWS Config records configuration changes for supported ElastiCache resources and evaluates them against compliance rules. Managed rules can check settings such as encryption, automatic failover, and backup retention.
- **[AWS Database Migration Service (AWS DMS)](https://blowstack.com/tools/cloud-services-hub/aws-database-migration-service-(aws-dms))**: ElastiCache for Redis OSS can serve as a Redis target endpoint for AWS DMS migrations from supported source databases. DMS loads source data into Redis data structures; this integration does not support Memcached targets.
- **[AWS Elastic Beanstalk](https://blowstack.com/tools/cloud-services-hub/aws-elastic-beanstalk)**: ElastiCache can be configured alongside an Elastic Beanstalk environment through environment configuration files. Security-group rules allow the environment's application instances to reach the cache, for example to store shared session data.
- **[AWS Fault Injection Service](https://blowstack.com/tools/cloud-services-hub/aws-fault-injection-simulator-(aws-fis))**: ElastiCache replication groups support AWS Fault Injection Service experiments that interrupt cache availability in a selected Availability Zone. These experiments help test application behavior and recovery during an Availability Zone disruption.
- **[AWS Key Management Service (AWS KMS)](https://blowstack.com/tools/cloud-services-hub/aws-key-management-service-(aws-kms))**: ElastiCache uses AWS KMS keys for encryption at rest on supported caches and their backups. Customer managed keys let you control key permissions and lifecycle for encrypted cache data.
- **[AWS Local Zones](https://blowstack.com/tools/cloud-services-hub/aws-local-zones)**: Supported node-based ElastiCache deployments can run in AWS Local Zones. Placing a cache near application resources in the same Local Zone reduces network latency for cache operations.
- **[AWS Outposts](https://blowstack.com/tools/cloud-services-hub/aws-outposts)**: ElastiCache can deploy supported cache node types into subnets on AWS Outposts. This places managed caching capacity on premises for applications that need local data access and low latency.
- **[AWS PrivateLink](https://blowstack.com/tools/cloud-services-hub/aws-privatelink)**: ElastiCache supports interface VPC endpoints for private access to its management API through AWS PrivateLink. Management requests can stay on the AWS network without requiring an internet gateway or NAT gateway; cache data connections use the cache's own endpoints.
- **[AWS Resilience Hub](https://blowstack.com/tools/cloud-services-hub/aws-resilience-hub)**: AWS Resilience Hub assesses supported ElastiCache resources as part of an application's resilience evaluation. It examines configurations such as replication and Availability Zone placement and recommends changes to meet recovery objectives.
- **[AWS Resource Groups and Tag Editor](https://blowstack.com/tools/cloud-services-hub/aws-resource-groups-and-tag-editor)**: Supported ElastiCache resources can be organized into tag-based resource groups and have their tags managed through Tag Editor. This helps manage caches belonging to a particular application or environment.
- **[AWS Secrets Manager](https://blowstack.com/tools/cloud-services-hub/aws-secrets-manager)**: Secrets Manager can store and rotate credentials for ElastiCache users through an ElastiCache-specific Lambda rotation function. Rotation updates the user's password in ElastiCache and the corresponding secret used by applications.
- **[AWS Security Hub](https://blowstack.com/tools/cloud-services-hub/aws-security-hub)**: AWS Security Hub evaluates ElastiCache configuration through security controls and reports findings for failed checks. These controls cover protections such as encryption, authentication, backups, and automatic failover.
- **[AWS Step Functions](https://blowstack.com/tools/cloud-services-hub/aws-step-functions)**: Step Functions can invoke ElastiCache management APIs through its AWS SDK service integration. A state machine can create a snapshot, check its status, and coordinate subsequent maintenance steps without a custom Lambda function for each API call.
- **[AWS Systems Manager](https://blowstack.com/tools/cloud-services-hub/aws-systems-manager)**: Systems Manager Automation provides ElastiCache-specific troubleshooting runbooks. For example, a connectivity troubleshooting runbook can inspect cache configuration and network settings to help diagnose why a client cannot connect.
- **[AWS Trusted Advisor](https://blowstack.com/tools/cloud-services-hub/aws-trusted-advisor)**: Trusted Advisor provides ElastiCache checks covering areas such as fault tolerance and reserved-node cost optimization. Its recommendations can identify replication groups that need stronger failover protection or workloads that could benefit from reserved capacity.

## What is Amazon ElastiCache

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

- [Cache-Aside](https://blowstack.com/tools/cloud-concepts-hub/cache-aside): Cache-aside is a caching pattern in which application code checks a cache first and, on a miss, reads from the authoritative data store and populates the cache.
- [Caching](https://blowstack.com/tools/cloud-concepts-hub/caching): Caching stores reusable copies of data or computed results closer to consumers or on faster storage to reduce retrieval time and repeated work.
- [Write-Through Caching](https://blowstack.com/tools/cloud-concepts-hub/write-through-caching): Write-through caching updates the cache and the backing data store synchronously as part of the write operation.
- [Cache Invalidation](https://blowstack.com/tools/cloud-concepts-hub/cache-invalidation): Cache invalidation is the process of making cached data unusable or requiring it to be checked again when it may no longer match the authoritative source.
- [In-Memory Caching](https://blowstack.com/tools/cloud-concepts-hub/in-memory-caching): In-memory caching stores frequently accessed data in RAM so applications can retrieve it quickly without repeatedly querying a slower source.
- [In-Memory Databases](https://blowstack.com/tools/cloud-concepts-hub/in-memory-databases): In-memory databases keep their primary working data in RAM to deliver low-latency reads and writes with high throughput.
- [Precomputation](https://blowstack.com/tools/cloud-concepts-hub/precomputation): Precomputation performs predictable work before a request arrives so that results or intermediate artifacts are ready when needed.
- [Sharding](https://blowstack.com/tools/cloud-concepts-hub/sharding): Sharding divides a dataset into horizontal subsets distributed across storage or compute resources so that capacity and workload can scale beyond a single resource.
- [Database](https://blowstack.com/tools/cloud-concepts-hub/database): A database is an organized collection of data that applications can efficiently store, retrieve, update, and manage.
- [High performance](https://blowstack.com/tools/cloud-concepts-hub/high-performance): High performance is the ability of a system to meet workload-specific response-time and processing-rate targets under expected operating conditions.
- [Key-Value Data Model](https://blowstack.com/tools/cloud-concepts-hub/key-value-data-model): The key-value data model stores each value under a unique key so applications can retrieve, update, or delete it directly.
- [Polyglot Persistence](https://blowstack.com/tools/cloud-concepts-hub/polyglot-persistence): Polyglot persistence is the use of different database technologies within an application or system to match distinct data models, access patterns, and operational requirements.
- [Random I/O](https://blowstack.com/tools/cloud-concepts-hub/random-io): Random I/O is a storage access pattern in which reads or writes target nonconsecutive locations rather than progressing sequentially through data.
- [Session Affinity](https://blowstack.com/tools/cloud-concepts-hub/session-affinity): Session affinity is a load-balancing behavior that routes a client's related requests to the same backend target while the affinity remains valid and the target is available.
- [Time to Live](https://blowstack.com/tools/cloud-concepts-hub/time-to-live): Time to Live is a limit on how long data remains valid, reusable, or retained before expiration handling applies.

## Amazon ElastiCache exam questions

Real practice exam questions on Amazon ElastiCache, with the correct answer and its explanation.

### Question 1 (CLF-C02)

**Question:**

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?

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

**Explanation:** 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.

### Question 2 (MLA-C02)

**Question:**

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?

**Correct 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.

**Explanation:** 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.

### Question 3 (SAP-C03)

**Question:**

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?

**Correct 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.

**Explanation:** 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.

### Question 4 (SOA-C03)

**Question:**

A company runs an API on an Amazon EC2 Auto Scaling group. The API caches expensive calculations for immutable historical datasets in a node-based Amazon ElastiCache for Valkey replication group. Cache entries have no expiration because the underlying datasets never change. On a cache miss, the application recalculates the result and stores it in the cache.

As users request more datasets, cache memory fills with results that are rarely requested again. The primary node begins rejecting cache writes. The frequently reused results fit comfortably in the primary node's memory, and cache CPU utilization is low. The current maxmemory-policy is noeviction.

A CloudOps engineer must allow new results to be cached by automatically removing less recently used results when memory is full. The solution must retain the current primary node type and require no application changes.

Which change meets these requirements?

**Correct answer:** Change the maxmemory-policy to allkeys-lru.

**Explanation:** The allkeys-lru policy can evict keys regardless of whether they have an expiration, preferentially removing less recently used entries through an approximate LRU algorithm. This allows new results to be cached while retaining frequently reused results, without resizing the primary or changing application code.

### Question 5 (AIP-C01)

**Question:**

A manufacturer uses Amazon Bedrock to generate equipment-part compatibility explanations. Each request also requires current inventory from an authoritative inventory API. The application displays the explanation and inventory in separate sections using a fixed template; no model invocation is needed to combine them.

Compatibility explanations depend only on the equipment model, part number, manual revision, language, and deployed prompt and model versions. These explanations are reusable, and users frequently request the same combinations. Inventory changes unpredictably, and every response must include an inventory API read performed during that request. A previously returned inventory value is not acceptable, even if it is only seconds old.

The developer must reduce response latency and avoid repeated model inference for reusable explanations while preserving both requirements. Which design should the developer implement?

**Correct answer:** Store only the compatibility explanation in Amazon ElastiCache, keyed by all inputs that determine it. For each request, read the inventory API and look up the explanation independently. Invoke Bedrock and populate the entry on an explanation miss, then render the two sections.

**Explanation:** This places the reuse boundary around the stable, independently generated explanation. The complete key prevents reuse across different compatibility inputs or deployed versions. Cache hits avoid model inference, while every request still obtains inventory directly from the authoritative API.

### Question 6 (DVA-C02)

**Question:**

A delivery application stores routing rules in a relational database and uses Amazon ElastiCache for Redis OSS to cache individual rules. Dispatchers frequently read a rule immediately after an administrator creates or edits it. Currently, these first reads miss the cache and query the database, causing latency spikes.

The database must remain the authoritative store. During normal operation, the first read after a successful create or edit must retrieve the committed rule from the cache without querying the database, even if the rule was not previously cached. The team can accept additional latency for administrative writes. Updates to each rule are serialized. Assume no cache failures, expirations, or evictions during these operations.

Which change should a developer make?

**Correct answer:** Commit the rule to the database, set its cache key to the committed value whether or not the key already exists, and return success only after the cache update completes.

**Explanation:** This implements write-through caching in the application. The write path persists the rule and populates or refreshes the cache before acknowledging success. Under the stated assumptions, the next read is a cache hit, including for newly created rules. The trade-off is additional write latency.

### Question 7 (DOP-C02)

**Question:**

A company stores user session state in an Amazon ElastiCache for Redis OSS global datastore. The primary replication group is in us-east-1, and a secondary replication group is in eu-west-1. Both regional replication groups have Multi-AZ and automatic failover enabled. A standby application in eu-west-1 has enough capacity to serve all users. Each application deployment is configured with its regional replication group's primary endpoint.

During a complete us-east-1 outage exercise, the standby application can read replicated sessions but cannot update them. All nodes in eu-west-1 are healthy. The company requires an approved automation runbook to restore session writes by using the existing secondary data nodes, without waiting for us-east-1 to recover. The business accepts the loss of updates that had not replicated before the outage.

Which recovery action should the runbook perform?

**Correct answer:** Invoke FailoverGlobalReplicationGroup with the eu-west-1 replication group as the target primary. After promotion completes, reconnect the standby application to its regional primary endpoint and direct users to the standby deployment.

**Explanation:** A global datastore requires a cross-Region role change to make a secondary replication group writable. FailoverGlobalReplicationGroup promotes the specified secondary using its existing nodes. After promotion, the standby application can write through that group's primary endpoint. Because cross-Region replication is asynchronous, updates that had not reached the secondary can be lost.

### Question 8 (SAA-C03)

**Question:**

A publishing company stores technical articles in Amazon RDS for PostgreSQL. Its application checks Amazon ElastiCache before each article read. If an entry is missing, the application retrieves the article from RDS and caches it for 1 hour. An automated editing process updates thousands of articles daily, but most updated articles are not subsequently read.

Currently, edits update only RDS, so readers sometimes receive outdated articles from the cache. The company wants the first read after a successful edit to retrieve the updated article without waiting for cache expiration. Edits must be durably stored before they are acknowledged, and the editing process must not create cache entries for articles that might never be read. For this workflow, reads do not overlap edits to the same article.

Which change should a solutions architect recommend?

**Correct answer:** Commit each edit to RDS, then delete the corresponding ElastiCache entry before acknowledging the edit. Leave the existing cache-miss read logic unchanged.

**Explanation:** Database-first invalidation fits the existing cache-aside design. RDS durably stores the edit, and deleting the cached copy causes the next read to retrieve and cache the updated article. Articles that are edited but never read do not consume new cache capacity. The stated absence of overlapping reads and edits avoids concurrent repopulation races.

## Practice Amazon ElastiCache in a full exam

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

- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 22 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 10 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 8 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 6 questions
- [CLF-C02](https://blowstack.com/practice-exams/aws-certified-cloud-practitioner): 5 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 4 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 4 questions
- [MLA-C02](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 1 question

## Learn Amazon ElastiCache in lessons

13 short lessons on Amazon ElastiCache in 7 certification courses.

- CLF-C02: Amazon ElastiCache: in-memory caching (Premium), https://app.blowstack.com/lessons/amazon-elasticache-in-memory-caching-clf-c02
- MLA-C02: Amazon ElastiCache vs Amazon DynamoDB: choosing a state store (Premium), https://app.blowstack.com/lessons/amazon-elasticache-vs-amazon-dynamodb-choosing-a-state-store-mla-c02
- SAP-C03: Amazon ElastiCache: resilience of externalized application state (Premium), https://app.blowstack.com/lessons/amazon-elasticache-resilience-of-externalized-application-state-sap-c03
- SOA-C03: Amazon ElastiCache: scaling an application cache (Premium), https://app.blowstack.com/lessons/amazon-elasticache-scaling-an-application-cache-soa-c03
- AIP-C01: Amazon ElastiCache: inference response caching (Premium), https://app.blowstack.com/lessons/amazon-elasticache-inference-response-caching-aip-c01
- DOP-C02: Amazon ElastiCache: replication and automatic failover (Premium), https://app.blowstack.com/lessons/amazon-elasticache-replication-and-automatic-failover-dop-c02
