Search overlay panel for performing site-wide searches
Salesforce (Heroku) Named a Leader. Learn More!

Heroku Key-Value Store Now Supports Valkey 8.1 with JSON and Bloom Modules

We’re thrilled to announce the general availability of Valkey v8.1 in Redis OSS compatible Heroku Key-Value Store. This isn’t just an incremental update; it’s a significant leap forward, bringing enhanced performance and greater efficiency. To add to this excitement, we’re bringing powerful new module capabilities to v8.1, with Valkey Bloom and ValkeyJSON.

For years, Heroku customers have relied on our managed in-memory data store services for caching, session management, real-time leaderboards, queueing, and so much more. Valkey is a drop-in, open-source fork of Redis OSS at v7.2, maintained by the Linux Foundation, and is backwards compatible with Redis OSS protocols and clients. With Valkey v8.1, we’re continuing our commitment to providing you with a robust, scalable, and developer-friendly in-memory datastore. We are delivering this enhancement to empower you to build faster, smarter, and more efficient applications on Heroku.

What’s New in Valkey v8.1

Valkey v8.1 itself comes packed with core improvements designed to make your applications perform:

  • Enhanced Performance: Experience lower latencies and higher throughput. Valkey v8.1 features a new, more memory-efficient hash table implementation and optimizations in I/O threading. This means your apps can handle more requests, faster. Active memory defragmentation also sees a significant reduction in request latency.
  • Better Memory Efficiency: Squeeze more out of your instances. The new hash table design reduces memory usage per key, allowing you to store more data cost-effectively.

These improvements mean your existing Heroku Key-Value Store use cases will run faster and more efficiently, mostly without needing any changes on your end.

How to upgrade to Valkey v8.1

You can upgrade your Heroku Key-Value Store instance to the latest version with:

heroku redis:upgrade –version 8.1 –app app-name

If you’re on mini, above command will upgrade your instance immediately. If you’re on premium or larger plans, the above command will prepare the maintenance and you can upgrade by running maintenance.

Valkey 8 Benchmark Highlights (vs Valkey 7.2)

To give you a clearer picture of the performance uplift, our internal benchmarks (combination of SETS and GETS operations) comparing Valkey 8.0 (a precursor to 8.1, sharing many core enhancements) with Valkey 7.2 on various Heroku Key-Value Store premium plans show significant improvements. Here’s a snapshot of the average gains observed:

Heroku Plan (Cores) Valkey 8.0 vs 7.2: Ops/sec Increase Valkey 8.0 vs 7.2: Avg. Latency Reduction
premium-7 (2 cores) ~6.5% ~6.1%
premium-9 (4 cores) ~37.4% ~27.3%
premium-10 (8 cores) ~44.7% ~25.3%
premium-12 (16 cores) ~164.6% ~63.0%
premium-14 (32 cores) ~201.8% ~62.5%

These benchmarks demonstrate that as you scale to plans with more CPU cores, the performance advantages of Valkey 8.x become even more pronounced, allowing your applications to handle substantially more operations per second with lower latency. While specific gains can vary by workload, the trend is clear: Valkey 8.1 is engineered for speed and efficiency. We offer a variety of Heroku Key-Value Store options to tailor to your needs.

Valkey Bloom & ValkeyJSON: Powerful New Modules for Heroku Key-Value Store

The real headline-grabbers with this release are the new, highly anticipated modules now available: Valkey Bloom and ValkeyJSON. These modules (similar to extensions on Heroku Postgres) unlock entirely new ways to leverage the power and simplicity of Heroku Key-Value Store within your Heroku applications. Let’s go over each one in more detail!

Valkey Bloom: Probabilistic Data Structures for Efficiency

Valkey Bloom introduces Bloom filters, a probabilistic data structure that excels at quickly and memory-efficiently determining if an element is probably in a set, or definitely not in a set.

  • Benefit: Bloom filters can dramatically reduce the load on your primary databases and improve application efficiency by avoiding unnecessary, expensive lookups for items that don’t exist. They achieve this with remarkable memory savings – potentially over 90% compared to traditional methods for some applications.
  • Use Cases:
    • Cache “Probably Not Found” Queries: Before hitting your main database for an item, quickly check a Bloom filter. If it says the item is definitely not there, you save a costly database query. This is fantastic for recommendation engines (filtering out already-seen items), unique username checks, or fraud detection systems (checking against known fraudulent IPs or transaction patterns).
    • Content Filtering: Efficiently check against large lists of malicious URLs or profanity.
    • Ad Deduplication: Ensure users aren’t shown the same advertisement repeatedly.

While Bloom filters have a chance of a “false positive” (saying an item might be in the set when it isn’t), they guarantee no “false negatives” (if it says an item isn’t there, it’s truly not there). For many use cases, this trade-off is incredibly valuable for the performance and memory gains.

ValkeyJSON: Native JSON Handling for Rich Data Structures

Many modern applications rely heavily on JSON. With ValkeyJSON, you can now work with JSON data more naturally and efficiently within a Heroku Key-Value Store instance.

  • Benefit: ValkeyJSON provides native support for storing, retrieving, and manipulating JSON documents. This allows for atomic operations on specific parts of a JSON object without needing to fetch and parse the entire thing in your application, leading to better performance and simpler application code.
  • Use Cases:
    • Store Complex Objects: Easily store user profiles, product catalogs with nested attributes, configuration data, or any other complex objects as JSON documents.
    • Atomic Updates: Modify specific fields within a JSON document directly in Valkey. For example, update a user’s last login time or add an item to an array within a product’s attributes without rewriting the whole object.
    • Simplified Development: Reduce boilerplate code for serializing and deserializing JSON in your application.

If your application deals with structured but flexible data, ValkeyJSON can significantly streamline your data management and improve performance.

Getting Started with Valkey Modules on Heroku Key-Value Store

Once you upgrade to Valkey v8.1, these powerful modules are already enabled and commands can be used. For example, to add an item to bloom filter through the CLI:

BF.ADD name-of-filter item-to-insert

We encourage you to explore the official Valkey documentation for Valkey Bloom and Valkey JSON to dive deeper into their commands and capabilities.

Valkey v8.1 & Module Power: Your Faster, More Flexible Heroku Data Store

The addition of Valkey v8.1, along with the Valkey Bloom and ValkeyJSON modules to Heroku Key-Value Store offerings, represents a significant step forward in the capabilities available to you on the Heroku platform. We’re excited to see how you’ll leverage these new tools to build the next generation of innovative applications.

As always, we’re here to support you if you get stuck. Stay tuned for more detailed guides and examples on using these new features. For now, get ready to explore the enhanced power and flexibility of Heroku Key-Value Store! Happy coding!