- Route 53 Rundown
- Posts
- Switching from Redis to Valkey on AWS ElastiCache Will Save 20% and Boost Performance
Switching from Redis to Valkey on AWS ElastiCache Will Save 20% and Boost Performance
In the fast-paced world of cloud computing, optimizing performance while keeping costs in check is a constant balancing act.
If you're using Amazon ElastiCache for Redis OSS, there's a compelling opportunity to achieve both goals of performance and costs by switching to Valkey, an open-source, high-performance fork of Redis.
In this blog, we'll explore why migrating to Valkey on AWS ElastiCache is a smart move, how it can save you up to 20% on node-based clusters and 33% on serverless deployments, and how to make the transition seamlessly.
What is Valkey, and Why Should You Care?
Valkey is an open-source, in-memory key-value datastore that emerged as a fork of Redis OSS version 7.2.4 in March 2024, following Redis Inc.'s decision to shift away from the open-source BSD license to more restrictive licenses (RSALv2 and SSPLv1). Hosted by the Linux Foundation and backed by major players like AWS, Google, and Oracle, Valkey is designed as a drop-in replacement for Redis OSS, offering full compatibility with Redis APIs and data formats. This means you can migrate your existing Redis-based applications to Valkey without any code changes, all while unlocking significant cost savings and performance improvements.
AWS put out this video on upgrading to Valkey:
AWS has integrated Valkey into its ElastiCache and MemoryDB services, making it easier than ever to leverage this powerful alternative. With over 500,000 container pulls and thousands of contributions since its inception, Valkey is rapidly gaining traction as a community-driven, cost-effective solution for caching and in-memory data storage.
The Cost-Saving Advantage of Valkey
One of the most compelling reasons to switch to Valkey is the significant cost reduction it offers on AWS ElastiCache: Node-Based Clusters: ElastiCache for Valkey is priced up to 20% lower than ElastiCache for Redis OSS. For example, a 3-node cache.r6g.8xlarge cluster in the Ireland region costs approximately $8,024/month for Redis but only $6,419/month for Valkey—a savings of about $1,605/month, or roughly 20%.
Serverless Deployments: ElastiCache Serverless for Valkey offers an even more dramatic 33% lower pricing compared to Redis OSS, with a minimum data storage requirement of just 100 MB (90% lower than the 1 GB minimum for Redis). This translates to a starting cost as low as $6/month, making it ideal for small projects or development environments.
Granular Billing: Valkey’s serverless option bills data storage to the nearest 100 MB, compared to 1 GB for Redis, ensuring you pay only for what you use. This granularity can lead to substantial savings, especially for smaller or variable workloads.
Reserved Node Flexibility: If you’re using reserved nodes for ElastiCache, you can switch to Valkey and retain your existing discounted rates while benefiting from the 20% lower pricing for Valkey nodes. This effectively gives you more value from your reserved instances.
For large-scale deployments, the savings can be transformative. One enterprise reportedly saved $800,000 annually by migrating their ElastiCache deployment to Valkey, simply by clicking a button in their AWS console.
Performance Benefits of Valkey
Beyond cost savings, Valkey offers performance enhancements that make it a worthy successor to Redis:
Improved Throughput and Latency: Valkey 8.0 introduces a new I/O threading architecture, delivering up to 230% higher throughput and 70% better latency compared to Valkey 7.2 (which is equivalent to Redis OSS 7.2). For example, posts on X highlight that Valkey achieves 37% higher throughput on SET operations and 16% higher on GET operations, with p99 latencies up to 60% faster for GET operations.
Memory Efficiency: Valkey reduces memory overhead by up to 20.6%, allowing you to store more data with the same resources. This is particularly valuable for memory-intensive workloads like caching or session stores.
Multi-Core Utilization: Valkey’s enhanced I/O threading leverages multiple cores more effectively, doubling throughput for a given core count compared to Redis OSS.
These improvements make Valkey not just a cost-saving alternative but a performance upgrade, especially for high-throughput applications like leaderboards, real-time analytics, or session management.
Why Switch Now?
The shift to Valkey is particularly timely due to Redis’s licensing changes. Redis OSS on ElastiCache is locked at version 7.1, released in mid-2023, meaning users are stuck with an older version that misses out on newer features and optimizations. Valkey, on the other hand, is actively developed with contributions from a vibrant community, ensuring ongoing innovation and support.
Additionally, Valkey’s open-source BSD 3-clause license avoids the restrictions of Redis’s new licensing model, eliminating concerns about vendor lock-in and enabling broader adoption across cloud providers. With AWS’s commitment to the Valkey project, you can trust that it will remain a secure, reliable, and future-proof solution.
How to Migrate from Redis to Valkey on ElastiCache?
Migrating to Valkey is designed to be seamless, with zero downtime and no code changes required. Here’s a step-by-step guide to get you started:
Check Compatibility: Ensure your ElastiCache for Redis OSS cluster is running version 5.0.6 or higher. Valkey is compatible with Redis OSS APIs and data formats, so no application changes are needed. For versions earlier than 5.0.6, a brief DNS propagation delay (30–60 seconds) may occur.
In-Place Engine Upgrade: AWS Console: Navigate to the ElastiCache dashboard, select your Redis cluster, click “Modify,” and choose Valkey as the engine version. You can apply the change immediately or schedule it for the next maintenance window.
AWS CLI: Use the modify-cache-cluster command to switch the engine to Valkey. For example: bash
aws elasticache modify-cache-cluster --cache-cluster-id <cluster_id> --engine valkey
Snapshot and Restore (Optional): For added safety, take a snapshot of your Redis cluster and restore it as a Valkey cluster. Use the following CLI command: bash
aws elasticache create-replication-group
--replication-group-id valkey-cluster
--replication-group-description "Valkey cluster"
--engine valkey
--engine-version 7.2
--snapshot-name <redis-snapshot-name>
--region <your-region>
Validate and Monitor: After migration, monitor your cluster’s performance using ElastiCache’s per-slot metrics and ensure your application behaves as expected. Tools like CloudFix can automate validation checks to confirm a successful transition.
Optimize Configurations: Adjust Valkey’s configuration parameters (e.g., eviction policies) to suit your workload. Note that serverless caches have non-modifiable parameters, while self-designed clusters allow customization.
For automated migrations, tools like CloudFix’s Valkey Finder/Fixer can identify eligible clusters, estimate savings, and execute the migration with a single click, making the process even easier.
Real-World Example:
$800,000 in Savings Consider a large-scale application running a write-heavy session store on ElastiCache for Redis with a 3-node cache.r6g.8xlarge cluster. By switching to Valkey, the organization reduced costs from $8,024/month to $6,419/month—a 20% savings, totaling over $19,000 annually for that cluster alone.
For enterprises with multiple clusters, the savings can scale to hundreds of thousands of dollars, as demonstrated by one customer who saved $800,000 by migrating their ElastiCache deployment to Valkey.
Best Practices for a Smooth Transition Test in Pre-Production: Validate the migration in a non-production environment to ensure compatibility with your application’s workload.
Use Reader Endpoints: Distribute read traffic to replicas to optimize performance, especially for read-heavy applications.
Implement Connection Pooling: Use client connection pooling and exponential backoff with jitter to avoid overwhelming the server during migration.
Monitor Costs: Post-migration, track your ElastiCache costs using tools like CloudYali or AWS Cost Explorer to confirm savings and identify further optimization opportunities.
Conclusion:
A No-Brainer for Cost and Performance Switching from Redis to Valkey on AWS ElastiCache is a rare opportunity to cut costs by up to 20% for node-based clusters and 33% for serverless deployments, all while improving performance and avoiding vendor lock-in. With zero-downtime migrations, full Redis API compatibility, and AWS’s robust support, the transition is as simple as a few clicks or CLI commands.
Whether you’re running a small development cache or a large-scale production workload, Valkey offers a cost-effective, high-performance alternative that’s hard to ignore. Ready to start saving? Head to the AWS ElastiCache console or check out the ElastiCache for Valkey documentation to begin your migration today. For deeper insights into cloud cost optimization, tools like CloudYali can help you track savings and uncover additional opportunities across your AWS infrastructure.
By making the switch, you’re not just cutting costs—you’re investing in a more efficient, scalable, and future-proof caching solution. Why pay more when you can do more with less?