AWS Cost Efficiency

Save costs on AWS Elasticache and MemoryDB by migrating to Valkey from Redis

On October 8th, AWS announced support for Valkey for both Elasticache and MemoryDB. Valkey is an open-source, high-performance, in-memory key-value datastore and serves as a drop-in replacement for Redis OSS.

The announcement states:

Valkey support announcement from AWS

A similar announcement was made for MemoryDB.

Key points:

  1. Valkey is more cost-effective: Pricing is lower in both elasticache and memoryDB for Valkey compared to other engines.
  2. It is open source: Valkey is governed by the Linux Foundation, and available under a BSD license much like Redis used to be.
  3. Easy migration: Valkey is a drop-in replacement for Redis OSS, allowing seamless migration with just a few clicks.

But what happened to Redis?

On March 20, 2024, Redis announced a significant change to its licensing terms. Redis is no longer open-source under the widely-used BSD (3-clause) license. Instead, it now operates under more restrictive licenses: the Redis Source Available License (RSALv2) and the Server Side Public License (SSPLv1). The key differences between these licenses are outlined below:

Why the change? The shift in Redis’s licensing can be traced to changes in its stewardship over the years. Redis started as an open-source project by Salvatore Sanfilippo and gained widespread adoption, with early sponsorship from VMware. However, around 2014, venture capital-backed Redis Labs (previously Garania Data and now Redis Inc.) took over stewardship. As the company grew, its focus shifted from maintaining an open-source model to monetizing the technology, leading to the more restrictive licensing terms seen today.

The birth of Valkey

Redis is (was) one of the beloved open-source projects with strong support from a large number of companies and an active community of contributors. This licencing change which goes against the open-source ethos, did not sit well with them.

While the change seemed evident, an AWS employee contributing to Redis created a fork to keep up with open-source development. Support started rallying behind this effort. The Linux Foundation came on board announcing the launch of Open Source Valkey Community a week after Redis changed its terms. 

Thus, the Valkey was born.

Here is the Valkey fork that starts with - “This project was forked from the open source Redis project right before the transition to their new source available licenses.” Valkey rapidly gained traction, with a significant portion of the contributor community shifting their efforts to support it. In fact, within a short period, two-thirds of the companies that had previously backed Redis moved their support to Valkey.

(Interestingly, Microsoft had created their own fork just a few days before Redis moved away from open-source. It is called Garnet)

Should you be skeptical of this new project?

No, there's no need for skepticism. Think of Valkey as the new name for Redis—it's a direct fork of Redis that maintains the open-source principles Redis once championed.

It may seem unfamiliar for now—GPT models might not recognize the term "Valkey," and even Google suggests it's a typo for "valley." While writing this, every mention of "Valkey" still gets flagged as a spelling error.

But this is legit, Valley is going to be here and it is going to take the place of Redis open source soon. It is backed by the Linux Foundation, AWS and many other industry leaders and contributors. It will soon replace Redis in AWS and elsewhere.

Valkey’s Enhancements over Redis

Performance

  • Multi-threading: Valkey introduces multi-threading to handle I/O and command execution, allowing it to fully utilize multi-core processors. This offers significant throughput improvements, particularly for write-heavy workloads, compared to Redis’s predominantly single-threaded architecture.
  • Asynchronous I/O: Valkey improves on Redis by using asynchronous I/O threading, reducing latency and enhancing responsiveness for real-time applications.
  • Memory Efficiency: Valkey optimizes memory usage with a more efficient dictionary structure, providing better performance under memory-intensive workloads. This is a notable improvement over Redis, particularly for applications with large data sets.

Advanced Clustering and Scalability

  • Automatic Failover: Valkey supports automatic cluster failover, which minimizes downtime by quickly recovering from node failures. It also provides better support for slot migration, reducing risks during cluster rebalancing.
  • Enhanced Clustering: Valkey’s clustering capabilities enable more seamless horizontal scaling compared to Redis, making it highly scalable across distributed environments.

Observability and Security

  • Per-slot metrics: Valkey offers per-slot metrics, providing deeper insights into performance and resource usage. It integrates smoothly with monitoring tools like Prometheus and Grafana, making it easier to visualize and optimize performance.
  • Advanced Security: Valkey comes with TLS support, fine-grained authentication, and Role-Based Access Control (RBAC), allowing organizations to implement more secure data management practices. While Redis has some security features, Valkey offers more advanced configurations out-of-the-box.

Though all these enhancements are noted, it essentially was planned for Redis. The Valkey project is taking it forward. If you are using AWS, shifting to Valkey in a no-brainer since you also save cost while getting enhanced performance.

Ways to Migrate from Redis to Valkey

1. In-Place Engine Upgrade(Preferred)

An In-Place Engine Upgrade for ElastiCache Redis allows you to migrate to valkey  without recreating the cluster. It updates the Redis engine directly within the existing cluster, preserving your data.

You can perform the migration through the AWS Console or AWS CLI.

AWS Console

  • Sign in to the AWS Management Console and navigate to ElastiCache from the AWS services menu.
  • In the ElastiCache dashboard, click on "Redis Clusters" and choose the cluster you want to migrate.
  • Click the "Modify" button for the selected cluster.
  • Locate the "Engine Version" section and select the desired Redis version from the available options.
  • Choose to either Apply Immediately or schedule the update for the next maintenance window.
  • Click "Modify Cluster" to confirm the changes.
  • Track the upgrade progress in the AWS Console. The status will initially show as "modifying" and will return to "available" once the upgrade is complete.

AWS CLI

To upgrade your Redis cluster using the AWS CLI, refer to the Modifying an ElastiCache Cluster documentation for more detailed instructions.

2) AWS Managed Online Migration

AWS Managed Online Migration in ElastiCache allows transferring data from an ElastiCache cluster to a Valkey or Redis OSS cluster without downtime, using the AWS Management Console. 

Steps:

  • Open ElastiCache Console – Sign in and navigate to ElastiCache.
  • Select/Create Cluster – Ensure it meets these conditions: Valkey 7.2+ / Redis OSS 5.0.6+, no AUTH, protected mode off, correct bind config, matching database count, and sufficient resources.
  • Start Migration – Choose Migrate Data from Endpoint, enter the IP and port, and click Start Migration.
  • Monitor Progress – Track under Events. The cluster will change to Modifying → Migrating.
  • Stop Migration (Optional) – Choose Stop Data Migration if needed.
  • Completion – If successful, the cluster enters Available status. If failed, check the event log.

Consider referring to Performing online data migration using the Console - Amazon ElastiCache for more detailed insights on AWS Managed Online Migration

3) Physical Snapshot Migration

A Physical Snapshot Migration involves creating a backup (snapshot) of your ElastiCache cluster and using that backup to migrate data to a new cluster, which could be in the same or different region. This method ensures that the data is preserved and transferred in a consistent state, and it is often used when migrating from one environment to another or when restoring a cluster after a failure.

Here are the steps for Physical Snapshot Migration in AWS ElastiCache:

  • Take a Snapshot: Create a snapshot of your existing ElastiCache cluster using the AWS Management Console or AWS CLI.
  • Copy the Snapshot (if needed): Copy the snapshot to another AWS region if you’re migrating across regions.
  • Restore the Snapshot: Create a new ElastiCache cluster and restore the snapshot to it.
  • Verify the Migration: Ensure the new cluster is working correctly with the migrated data.
  • Decommission Old Cluster: Once everything is confirmed, delete the old cluster to free up resources.

For more detailed insights, refer to the following links:

Comparison Table: Redis to Valkey Migration Methods

The table below compares three approaches:

Aspect In-Place Engine Upgrade(preferred) AWS Managed Online Migration Physical Snapshot Migration
Workflow Modify the existing Redis replication group to switch the engine via console/CLI Use the ElastiCache console/CLI to replicate data into a new Valkey cluster Create an RDB snapshot, transfer the dump file, then restore on Valkey
Downtime Minimal – data remains available while the engine type is switched Minimal – migration happens live via continuous replication Requires a maintenance window – you must pause writes for a consistent snapshot
Endpoint Impact Endpoints remain unchanged because the migration is performed in place Endpoints may change (if a new replication group is created), so clients might need DNS record updates or configuration changes New cluster endpoints are assigned – client configurations must be updated
Setup Complexity Straightforward – change engine type via AWS console/CLI (Cross-engine upgrade documentation) Moderate – involves using AWS migration tools and ensuring version/parameter group compatibility (AWS Migration Console, AWS Blog) Simple – just create a snapshot, transfer the file, and start Valkey manually (Percona Valkey Migration Guide)
Data Consistency Risk Low – as the upgrade happens in place, continuous replication minimizes data loss Low – live replication ensures that the data on Valkey remains in sync with Redis Higher – any writes after the snapshot begins are not captured
Scalability & Flexibility Preserves your current configuration while allowing engine changes without new endpoints Offers flexibility to also adjust instance types (e.g., downscale concurrently) Fixed to the snapshot state – scaling changes require re-deployment
Operational Impact Very low disruption – a seamless engine switch while keeping client connectivity intact Minimal disruption; migration is automated, and endpoints remain stable if managed correctly More disruptive due to required downtime and re-pointing client configurations


FinOps practitioners, how many times do you get the opportunity to save ~30% with a few clicks? Go for it.

Conclusion

Migrating from Redis to Valkey on AWS Elasticache and MemoryDB provides a cost-effective solution with improved performance, enhanced security, and better scalability. Valkey, as an open-source, drop-in replacement for Redis, offers a seamless transition while maintaining compatibility. AWS offers multiple migration methods such as In-Place Engine Upgrade, AWS Managed Online Migration, and Physical Snapshot Migration, ensuring minimal downtime and disruption. This migration is a great opportunity to save up to 30% while optimizing your cloud infrastructure for the future.

FAQs

1. What happens to my current contract and Reserved Instances (RIs)?

You can upgrade from Redis OSS to Valkey while still benefiting from existing contracts and reservations. Your current RIs will remain effective during and after the transition.

2. Are there any costs associated with migration from Redis to Valkey?

No, there is no cost associated with migration. After you migrate, Valkey pricing will be applicable going forward, which is considerably less than Redis.

3. Will there be any downtime for my application?

Valkey is an in-place replacement for Redis, and AWS promises that the shift won’t have any significant downtime. It can be up to a few minutes if not zero, depending on your specific setup and the complexity of your data.

4. Do I need to change my application?

No, all Redis commands work with Valkey since it is a fork of Redis. This change will be equivalent to version change/upgrade. So do take the general precautions that you take while upgrading the version.

5. What are the key performance improvements in Valkey compared to Redis?

Valkey introduces significant performance enhancements such as intelligent multi-core utilization and asynchronous I/O threading, which can improve throughput by over 2x compared to Redis 7.2.

6. Is Valkey suitable for production use?

Yes, Valkey 8.0 has undergone extensive testing and is considered ready for production usage by its Technical Steering Committee.

Subscribed !
Your information has been submitted
Oops! Something went wrong while submitting the form.

Similar Blog Posts

Maintain Control and Curb Wasted Spend!

Strategical use of SCPs saves more cloud cost than one can imagine. Astuto does that for you!