Dragonfly Cloud announces new enterprise security features - learn more

Question: How does ElastiCache data tiering work?

Answer

ElastiCache data tiering is a feature introduced by Amazon Web Services (AWS) to help customers scale and store data more cost-effectively in their ElastiCache for Redis clusters. Here’s a detailed overview of how it works:

Key Components

  1. Node Types: Data tiering is available on specific node types, namely the R6gd family, which are Graviton2-based nodes. These nodes have nearly 5x more total storage capacity compared to R6g nodes (memory only).

  2. Storage Layers: Data tiering utilizes both memory (DRAM) and solid-state drives (SSDs) within each cluster node. This allows for a more efficient use of resources by storing frequently accessed data in memory and less frequently accessed data on SSDs.

Mechanism

  • Least Recently Used (LRU) Algorithm: When the available memory capacity is fully consumed, ElastiCache uses an LRU algorithm to automatically move infrequently accessed items from memory to SSD. This ensures that the most frequently accessed data remains in memory for optimal performance.

  • Data Movement: When an item stored on SSD is accessed, ElastiCache moves it back to memory asynchronously before processing the request. This approach minimizes the performance impact, adding only about 300 microseconds of latency on average for requests to data stored on SSD compared to requests to data in memory.

Benefits

  • Cost Savings: By leveraging lower-cost SSDs, customers can achieve significant cost savings, up to 60% compared to using memory-only nodes when running at maximum utilization.

  • Scalability: Data tiering allows clusters to scale to hundreds of terabytes of capacity, making it ideal for large datasets where only a subset of the data is frequently accessed.

Use Cases

  • Workload Suitability: Data tiering is best suited for workloads where up to 20% of the dataset is frequently accessed (hot data), and the remaining 80% is infrequently accessed (warm data).

  • Performance Tolerance: Applications that can tolerate a small amount of additional latency when accessing infrequently used data can benefit significantly from data tiering.

Implementation

To get started with data tiering, you need to create a new ElastiCache cluster using one of the R6gd node types. This can be done via the AWS Management Console, AWS CLI, or SDKs. Data tiering is enabled automatically when using these node types, and you cannot opt out of it once selected.

Example Command

Here is an example of how to create a replication group with data tiering enabled using the AWS CLI:

aws elasticache create-replication-group \ --replication-group-id redis-dt-cluster \ --replication-group-description "Redis cluster with data tiering" \ --num-node-groups 1 \ --replicas-per-node-group 1 \ --cache-node-type cache.r6gd.xlarge \ --engine redis \ --cache-subnet-group-name default \ --automatic-failover-enabled \ --data-tiering-enabled \ --snapshot-name my-snapshot

This command sets up a new replication group with data tiering enabled on R6gd nodes.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Switch & save up to 80% 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost