Valkey is an open source, in-memory, high performance, key-value datastore. It is a drop-in replacement for Redis OSS. It can be used for a variety of workloads such as caching, session stores, and message queues, and can act as a primary database. Valkey can run as either a standalone daemon or in a cluster, with options for replication and high availability.
What is the history of Valkey
In March 2024, after Redis Inc. announced that future versions of Redis would no longer be open source, the Linux Foundation, Redis OSS developers, and contributors united to fork version 7.2 of Redis OSS and create the Valkey project. It is stewarded by the Linux Foundation and the community is rapidly improving Valkey with contributions from a vibrant developer community. Hosting the project under the Linux Foundation reassures the community that the open source license won’t be revoked or subject to the whims of a single organization. Valkey has seen rapid adoption since the project was created. It has been adopted by multiple Linux distributions, software providers, and cloud vendors, including AWS.
What are the benefits of using Valkey
Valkey improves performance of applications and databases - and it is developer friendly.
Performance
All Valkey data resides in memory, which enables low latency and high throughput data access. Unlike traditional databases, in-memory data stores don’t require a trip to disk. Because of this, in-memory data stores can support an order of magnitude more operations and faster response times. This results in the average read and write operations to be microseconds and support for millions of operations per second.
Flexible
Valkey has a vast variety of data types and data structures to meet your application needs. Valkey data types include:
- Sorted Sets – sets ordered by a value
- Hashes – a data structure for storing a list of fields and values
- Bitmaps – a data type that offers bit-level operations
- HyperLogLogs – a probabilistic data structure to estimate the unique items in a data set
- Streams - a log data structure Message queue
- Geospatial - a longitude-/latitude-based entries Maps, "nearby"
Simplicity and ease of use
Valkey comes with native data structures and many options to manipulate and interact with your data. Over a hundred open source clients are available for Valkey developers. Valkey supports most leading programming languages and protocols including Java, Python, PHP, Perl., C, C++, C#, JavaScript, Node.js, Ruby, R, Go, and many others.
Replication and persistence
Valkey employs a primary-replica architecture and supports asynchronous replication where data can be replicated to multiple replica servers. This provides improved read performance (as requests can be split among the servers) and faster recovery when the primary server experiences an outage. For persistence, Valkey supports point-in-time backups (copying the Valkey data set to disk).
Open source
Valkey is an open source project supported by a vibrant community. Valkey uses the Berkeley Software Distribution (BSD) 3-Clause license, allowing you to freely use and modify the source code. Valkey’s large, global community of contributors and enthusiasts bring many additional and long-tail benefits to using the in-memory caching engine.
High availability and reliability
Valkey is known for its high performance. It also supports multi-node architecture to enable it to meet the high availability needs of customers running mission critical production applications. Valkey offers a primary-replica architecture in a single node primary or a clustered topology. This allows you to build highly available solutions providing consistent performance and reliability. When you need to adjust your cluster size, various options to scale up and scale in or out are also available. This allows your cluster to grow with your demands.
What are the use cases for Valkey
We list some popular Valkey use cases below.
Caching
Valkey can be used to implement a highly available in-memory cache to decrease data access latency, increase throughput, improve application performance, and ease the load off your relational or NoSQL database. Valkey can serve frequently requested items at microsecond response times, and enables you to easily scale for higher loads without growing the costlier backend. Database query results caching, persistent session caching, web page caching, and caching of frequently used objects such as images, files, and metadata are all popular examples of caching with Valkey.
Chat, messaging, and queues
Valkey supports Pub/Sub with pattern matching and a variety of data structures such as lists, sorted sets, and hashes. This allows Valkey to support high performance chat rooms, real-time comment streams, social media feeds, and server intercommunication. The Valkey list data structure makes it easy to implement a lightweight queue. Lists offer atomic operations as well as blocking capabilities, making them suitable for a variety of applications that require a reliable message broker or a circular list.
Session store
Valkey as an in-memory data store with high availability and persistence is a popular choice among application developers to store and manage session data for internet-scale applications. Valkey provides the microsecond latency, scale, and resiliency required to manage session data such as user profiles, credentials, session state, and user-specific personalization.
Rich media streaming
Valkey offers a fast, in-memory data store to power live streaming use cases. Valkey can be used to store metadata about users' profiles and viewing histories, authentication information/tokens for millions of users, and manifest files to enable CDNs to stream videos to millions of mobile and desktop users at a time.
Geospatial
Valkey offers purpose-built, in-memory data structures, and operators to manage real-time geospatial data at scale and speed. It can be used to store, process, and analyze geospatial data in real-time make geospatial easy and fast. You can use Valkey to add location-based features such as drive time, drive distance, and points of interest to your applications.
Machine learning
Modern data-driven applications require machine learning to quickly process a massive volume, variety, and velocity of data and automate decision making. For use cases like fraud detection in gaming and financial services, real-time bidding in ad-tech, and matchmaking in dating and ride sharing, the ability to process live data and make decisions within tens of milliseconds is of utmost importance. Valkey gives you a fast in-memory data store to build, train, and deploy machine learning models quickly.
What is the difference between Valkey and Redis OSS
Valkey 7.2 is a drop-in replacement for Redis OSS. Valkey 8.0 has improved performance over Redis OSS. A significant feature in Valkey 8.0 was the introduction of a new I/O threading architecture, which improved the parallelism of the system and more efficiently executes commands. This new architecture supports up to 230% higher throughput and up to 70% better latency compared to Valkey 7.2. Valkey 8.0 also consists of a memory optimization that reduces up to 20.6% of the memory overhead, allowing users to store more data with the same amount of memory as earlier versions.
How can AWS support your Valkey requirements
AWS supports Valkey through our fully managed database services: Amazon ElastiCache and Amazon MemoryDB. These services make it easy to set up, operate, and scale Valkey workloads in the cloud.
Amazon ElastiCache for Valkey
Amazon ElastiCache is a Valkey-compatible and fully managed caching service that provides real-time performance for your applications. It provides microsecond read and write latency by caching data from primary databases and data stores. Hundreds of thousands of customers use Amazon ElastiCache to boost the performance of their databases and applications, achieve higher scale, and optimize their cost. With ElastiCache for Valkey, customers can benefit from a fully managed experience built on open source technology while taking advantage of the years of operational excellence, security, and reliability that ElastiCache provides.
With ElastiCache Serverless, you can set up a cache in under a minute and instantly scale to applications' demands. ElastiCache Serverless for Valkey is priced 33% lower and node-based ElastiCache for Valkey is priced 20% lower than other supported engines.
ElastiCache for Valkey is available for free trial with the AWS Free Tier. For more information on Amazon ElastiCache, check out the ElastiCache documentation.
Amazon MemoryDB for Valkey
Amazon MemoryDB is a Valkey-compatible, durable, in-memory database service that delivers ultra-fast performance. MemoryDB stores data durably across multiple Availability Zones (AZs) using a Multi-AZ transactional log to enable fast failover, database recovery, and node restarts. With MemoryDB, all of your data is stored in memory, which enables you to achieve microsecond read and single-digit millisecond write latency with high throughput.
MemoryDB for Valkey is priced 30% lower than other supported engine. MemoryDB for Valkey is available for free trial with the AWS Free Tier. For more information on Amazon MemoryDB, check out the MemoryDB documentation.