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.

How to Migrate to Valkey (Action Item)

From an implementation perspective, all the Redis commands will work on Valkey. It is a ‘drop-in’ replacement, so migration is just a few clicks. On top of that, it will save you some money.

This is what the AWS announcement says for Elasticache – “Valkey with Serverless priced 33% lower and node-based priced 20% lower than other supported engines

And for MemoryDB – “Valkey is priced 30% lower than MemoryDB for Redis OSS. With MemoryDB for Valkey, you are not charged for data written up to 10 TB/month. Any data written over 10TB/month is billed at $0.04/GB, which is 80% lower than MemoryDB for Redis OSS.”

The process of migrating is straightforward with minimal downtime as promised by AWS.

Go to console, then to your cluster settings and change Engine from Redis to Valkey!

Change engine type to Valkey in Cluster settings
Change engine type to Valkey in Cluster settings


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

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!