Dragonfly Cloud announces new enterprise security features - learn more

Question: How does Redis data tiering work?

Answer

Redis data tiering is a feature that allows developers to extend their Redis databases beyond the limits of DRAM (Dynamic Random Access Memory) by utilizing solid state drives (SSDs) for less frequently accessed data. Here’s a detailed overview of how it works:

Key Components

  1. DRAM and SSD Usage:

    • DRAM: Stores frequently accessed data, known as "hot data," to ensure real-time performance and low latency.
    • SSD: Stores less frequently accessed data, known as "warm data," which can tolerate slightly higher latency.
  2. Auto Tiering Mechanism:

    • Redis Enterprise’s auto tiering uses a high-performance storage engine (Speedb) to manage data between DRAM and SSD. This engine automatically moves data between these tiers based on access patterns, ensuring hot data remains in DRAM and warm data is stored on SSDs.
  3. Performance and Cost Benefits:

    • By using SSDs, Redis can significantly reduce infrastructure costs compared to using only DRAM. This can lead to cost savings of up to 70%.
    • The performance boost can be substantial, with up to 10,000 operations per second per core, doubling the performance of Redis on Flash.

Use Cases

  • Ideal Scenarios:

    • Applications with large datasets where only a portion of the data is frequently accessed. For example, user profiles or fraud detection systems where recent activity is more critical than historical data.
    • Workloads that access up to 20% of their overall dataset regularly, making it suitable for applications that can tolerate additional latency when accessing data on SSD.
  • Not Recommended Scenarios:

    • Applications with broad access patterns where any value could be pulled into RAM frequently, or those with large working sets that need to be stored entirely in RAM.
    • Use cases requiring persistent storage, as Redis data tiering is not intended for this purpose.

Implementation Details

  • Key Storage:

    • Keys themselves always remain in memory, while the values are moved between DRAM and SSD based on access patterns.
  • Eviction Policies:

    • Data tiering supports specific eviction policies such as volatile-lru, allkeys-lru, volatile-lfu, allkeys-lfu, and noeviction max memory policies.
  • Node Requirements:

    • For Amazon ElastiCache, data tiering is available on clusters using node types from the r6gd family, which must be part of a replication group and use Redis 6.2 or later.
  • Performance Impact:

    • Data tiering introduces minimal performance impact, with an average additional latency of 300 microseconds for requests to data stored on SSD compared to data in memory.

Comparison with Other Solutions

  • Redis Enterprise vs. Amazon ElastiCache:
    • Redis Enterprise offers a more mature and flexible data tiering solution, supporting more eviction policies and providing built-in data persistence, which is critical for many business applications.
    • Amazon ElastiCache’s data tiering is more limited in terms of supported eviction policies and does not support data persistence, making it less suitable for certain use cases.

By leveraging Redis data tiering, developers can build applications that handle large datasets efficiently, balancing performance and cost-effectiveness.

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