Amazon ElastiCache is a fully managed, in-memory caching service supporting flexible, real-time use cases. You can use ElastiCache for caching, which accelerates application and database performance, or as a primary data store for use cases that don't require durability like session stores, gaming leaderboards, streaming, and analytics. ElastiCache is compatible with Redis and Memcached. ElastiCache is compatible with Redis and Memcached to support flexible scaling for demanding, real-time applications. With ElastiCache, you pay only for what you use with no minimum fee. You are charged hourly based on the number of nodes, node type, and pricing model you select.
ElastiCache supports both on-demand nodes, which allow you to pay by hour with no long-term commitments, and reserved nodes, which offer discounts for customers who commit to either one-year or three-year terms. You may also incur costs associated with backup storage, data transfer within or across regions, or use of AWS Outposts.
Get started with Amazon ElastiCache for Free
As part of the AWS Free Tier, you can get started with Amazon ElastiCache for free. Upon signup, new AWS customers receive 750 hours of ElastiCache cache.t2.micro or cache.t3.micro node usage for free for up to 12 months.
The Amazon AWS Free Tier applies to participating services across our global regions. Your free usage under the AWS Free Tier is calculated each month across all regions and automatically applied to your bill – free usage does not accumulate. The AWS Free Tier is not available in the AWS GovCloud (US) regions or the China (Beijing) region at this time.
A node is the smallest building block of an ElastiCache cluster. In general, the current generation types provide more memory and computational power at lower cost when compared to their equivalent previous generation node types. For information on which node size to use, see choosing your node size.
Using on-demand nodes allows you to pay for memory capacity by hour with no long-term commitments. This model frees you from the costs and complexities of planning, purchasing, and maintaining hardware and helps transform large, fixed costs into smaller variable costs. When using on-demand nodes, you are billed hourly from the time a node is launched until it is terminated. Each partial node-hour consumed will be billed as a full hour.
Nodes with data tiering use solid state drives (SSD) to automatically optimize costs of your ElastiCache clusters by moving the least frequently used items from memory to SSD. Data stored on SSD exhibits slightly higher latency and lower throughput compared to data stored in memory. Nodes with data tiering, available for ElastiCache for Redis, are ideal for workloads that access up to 20% of their data regularly, and for applications that can tolerate additional latency the first time a less-frequently accessed item is needed. Amazon ElastiCache R6gd nodes with memory and solid state drives have nearly 5x more total storage capacity and can help customers achieve over 60% savings in price when running at maximum utilization compared to ElastiCache R6g nodes with memory only. See Example 4 below for a comparison on how data tiering can reduce your spend.
Reserved nodes provide a significant discount off the ongoing hourly usage rate for the node(s) you reserve in one-year or three-year terms. With reserved nodes, you can choose to:
- Pay low hourly charges with no upfront payment
- Make a one-time, partial upfront payment with lower hourly charges
- Pay all upfront for even lower hourly charges
You may designate nodes as reserved nodes by calling the purchasing API or selecting the reserved node option in the AWS console. When purchasing reserved nodes, you must designate a region, node type, payment term, and quantity. The reserved nodes may only be used in the designated region.
Reserved node pricing is also available for cluster nodes using data tiering.
Standard Reserved Nodes
Heavy Utilization Reserved Nodes
Backup storage is the storage associated with the automated and user-initiated snapshots. Amazon ElastiCache provides storage space for one snapshot free of charge for each active ElastiCache for Redis cluster. Additional backup storage is $0.085 per GB per month (same price in all regions). Data transfer for creating and restoring the snapshots is free of charge. Backup storage is only available for ElastiCache for Redis.
AWS Outposts is a fully managed service that extends AWS infrastructure, services, APIs, and tools to customers’ datacenters, co-location spaces, or on-premises facilities. By providing local access to AWS managed infrastructure, AWS Outposts enables you to build and run applications on-premises using the same programming interfaces as in AWS Regions, while using local compute and storage resources for lower latency and local data processing needs. ElastiCache for Outposts only supports M5 and R5 family nodes.
Example 1: Memcached, Single-AZ, On-Demand
You have a simple database caching use case that utilizes Amazon ElastiCache for
Memcached. Your total dataset size is 25 GB, and your application is architected for a single Availability Zone running in U.S. East (N. Virginia). You won’t need to maintain your environment for very long, so you opt for on-demand pricing. You decide to use
cache.m6g.large nodes in a five-node cluster as a balance between network performance, memory capacity, and limiting blast radius of node failures by biasing towards more, smaller nodes in a cluster architecture. As such, the total charges for your workload would be:
On-demand node charges
cache.m6g.large = $0.149 / hour
Total = $0.149 * 5 node cluster = $0.745 / hour
Example 2: High-Read, Multi-AZ, One-year, No Upfront Cost (Caching)
You have a read-heavy workload that utilizes Amazon ElastiCache for Redis. Your total dataset size is 150 GB of 200 byte objects. Your workload is 20 percent writes, 80 percent reads, and approximately 600,000 transactions per second. Since the workload is read-heavy, you use an ElastiCache architecture of one primary node and 5 replica nodes as the replicas can serve the read traffic. You choose the cache.r6g.8xlarge node type as it has enough memory to fit the entire working dataset on each node (keeping in mind the need for reserved memory). You also choose to deploy your workload
across two availability zones in U.S. East (N. Virginia). The overall workload size is predicted to be stable, so you opt to secure one-year reserved instances with no upfront purchase. Additionally, you utilize the free daily backup feature of ElastiCache and take an additional monthly backup. Your total charges are calculated as follows:
Reserved node charges with one-year commitment, no upfront
1 Primary + 5 Replicas = 6 total nodes
cache.r6g.8xlarge 1-year no upfront effective hourly pricing = $2.241 /hour
6 nodes * $2.241 = $13.446 /hour
Data transfer charges
600,000 transactions per second * 200 bytes * 60 minutes/hour * 60 seconds/minute = 432 GB /hour
Approximately 50 percent of your data will cross AZs due to multi-AZ architecture
432 GB * 50% * $0.01 /GB = $2.16 /hour
Backup storage charges
1 snapshot of 150 GB * $0.085 per GB /month= $12.75 /month
$12.75 / 730 hours in month = $0.017 /hour
Amazon ElastiCache node charges = $13.446 /hour
Data transfer charges = $2.16 /hour
Backup storage charges = $0.017 /hour
Total = $13.446 + $2.16 + $0.017 = $15.623 / hour
Example 3: High-Write with Global Datastore for Amazon ElastiCache for Redis, Three-year Upfront (Distributed session store use case)
You have a write-heavy distributed session store workload that utilizes Amazon ElastiCache for Redis. Since your users are located all over the United States, you opt to leverage Global Datastore in both U.S. East (N. Virginia) as the primary region and U.S. West (N. California) as the secondary region. Your total dataset size is 25 GB of 200 byte objects, and your traffic pattern is 50,000 writes per second and 50,000 reads per second on the primary region and 50,000 reads on the secondary region. You’ve opted to deploy a clustered architecture across three AZs with three shards and two replica nodes per shard, in each region. A shard is a collection of one to six Redis nodes. You expect this workload to be very stable and have opted to commit to reserved instances over three years with full upfront purchasing. For backups you are using the included, free backup. Your total charges would be calculated as follows:
Reserved node charges with 3-year commitment, all upfront
3 shards * 3 nodes per shard * 2 regions = 18 total nodes
cache.m6g.xlarge 3-year all upfront effective hourly pricing = $0.134 /hour
18 nodes * $0.134 = $2.412 /hour
Data transfer charges
100,000 reads per second * 200 bytes * 60 minutes /hour * 60 seconds /minute = 72 GB/hour
50,000 writes per second * 200 bytes * 60 minutes /hour * 60 seconds/minute = 36 GB/hour
Approximately 66% of your data will cross AZs due to multi-AZ architecture
(72 GB + 36 GB) * 50% * $0.01/GB = $0.475 + $0.238 = $0.713 /hour
Global Datastore replication traffic OUT = 36 GB /hour
36 GB * $0.02 = $0.72 /hr
Total = $0.72 + $0.713 = $1.433 /hour
Backup storage charge
Included backup per cluster = Free
Amazon ElastiCache node charges = $2.412 /hour
Data transfer charges = $1.433 /hour
Backup storage charges = Free
Total = $2.412 + $1.433 + $0 = $3.845 /hour
Example 4: Hosting a terabyte-scale cache with low-millisecond latencies using data tiering
You are running a reporting application and have chosen ElastiCache to boost performance of the underlying database. The application is temporal in nature, mostly accessing data generated over the last month, but is required to keep 12 months of data for compliance purposes. The application stores 85 GiB per month for a total of 1 TiB. Because your application uses mostly the most recent data, you select the cache.r6gd.16xlarge node type with data tiering. Your application is running in the US East (N. Virginia) region. You are not using read replicas, snapshots, Global Datastore, or any other billable ElastiCache feature. Your total charges are calculated as follows:
On-Demand Node Charges
Dataset size: 1 TiB (or 1024 GiB)
cache.r6gd.16xlarge usable memory capacity: 419.1 GiB/node, less 25% reserved memory: 419.1*.75 = 314.33 GiB/node
cache.r6gd.16xlarge solid-state drive (SSD) capacity: 1592.56 GiB
Total capacity per node: 314.33 + 1592.56 = 1906.89 GiB/node
Nodes required for dataset: 1024 GiB ÷ 1906.89 GiB/node = 1 node
cache.r6gd.xlarge on-demand price: $12.477/hr
Total hourly charge: 1 nodes * $12.477/hr = $12.48
Nodes required if running fully in memory: 1024 GiB ÷ 314.33 GiB/node for cache.r6g.16xlarge = 4 nodes
cache.r6g.16xlarge on-demand price: $6.567/hr
Hourly charge for running fully in memory: 4 nodes * $6.567/hr = $26.27
Savings compared to running fully in memory: $26.27 – ($12.48 / $26.27) = 52.5%