Aiven Blog

May 30, 2024

Aiven for Dragonfly vs Aiven for Caching benchmarking

Aiven offers two powerful in-memory data stores - Aiven for Dragonfly and Aiven for Caching. In this post we help you make the optimal choice for your project.

hoang-minh-vo

Hoang Minh Vo

|RSS Feed

Technical Product Manager

Speed is essential in the world of data access. When milliseconds matter, choosing the right in-memory data store can make or break your application's performance. This article delves into a head-to-head comparison of two prominent contenders that Aiven offers: Aiven for Dragonfly and Aiven for Caching.

Aiven for Caching is based on the Open Source version of Redis®(1), and holds a dominant position in the in-memory data store realm. Its proven track record, wide adoption, and mature feature set makes it a trusted choice for many developers.

Aiven for Dragonfly is based on Dragonfly, a fully Redis compatible database that has gained popularity since its release in 2022 with more than 22,000 stars on Github. Aiven for Dragonfly addresses the scalability limitation that Aiven for Caching has in terms of throughput and is proven to be more efficient than Redis for a larger workload.

(1) Redis has recently announced a change in their license by transitioning from the open-source BSD to the more restrictive Server Side Public License (SSPLv1). Starting with Redis 7.4, all subsequent versions will be dual-licensed under the Redis Source Available License (RSALv2) and SSPLv1.

The benchmark setup

We benchmarked Aiven for Caching and Aiven for Dragonfly in three different Aiven plans

  • Startup-56: 1 VM, 8 CPUs with 56gb available memory
  • Business-256: 2 dedicated VMs, 16 CPUs with 256gb available memory
  • Business-512: 2 dedicated VMs, 32 CPUs with 512gb available memory

All tests were run on the AWS environment in eu-west-1 region.

For each scenario, the database was preloaded with half of the maximum memory size available. Benchmark tests were run three times, increasing the amount of client threads each time.

Benchmarking was done using memtier_benchmark, the industry standard benchmarking tool for in-memory databases. It was deployed on a m6a.16xlarge instance with 64 cores to ensure the benchmarking tool itself is not the bottleneck, and used the same AWS eu-west-1 cloud region, to ensure maximum network bandwidth.

The following command was used for testing, tweaking the threads and clients parameters to achieve the maximum QPS throughput.

memtier_benchmark --host <host_name> --port <port_number> --tls --cacert <certificate_path> --threads <threads> --client <clients> --data-size 256 --ratio=1:1 --test-time 120

The results

Throughput

Throughput is the key metrics to dictate the performance of an in-memory database. And in this arena, Dragonfly clearly outmuscles Redis®. Our benchmarks reveal that Dragonfly can leverage all available CPUs, while Redis encounters bottlenecks and is only able to utilize a fraction of available CPU as CPU count rises. This translates to a staggering 7x throughput advantage for Dragonfly, across all our tests. Even more impressive, Dragonfly achieves this while maintaining sub-5ms latency. So, for applications demanding the highest processing power, Dragonfly might be the undisputed champion. Also, a higher throughput number can be achieved with both Redis and Dragonfly by pipelining requests on the client side.

Comparison throughput number between Aiven for Dragonfly vs Aiven for Caching

Latency

When choosing an in-memory database, response latency is crucial. Across our benchmarks, Aiven for Caching delivered slightly lower p50 and p99 latency compared to Aiven for Dragonfly. This advantage widened when pushing both clusters to their limits with increased client threads. However, Dragonfly still manages to maintain a sub 5ms latency despite having a significantly larger throughput number. If raw speed is your top priority under very specific workloads, Redis® might be worth considering. However, for well-rounded performance and scalability, Dragonfly is a compelling choice.

Comparison latency between Aiven for Dragonfly vs Aiven for Caching

Snapshotting

While Dragonfly boasts twice the speed for snapshotting, it faces a trade-off with a 30% throughput dip during the process. Conversely, Redis® prioritizes consistency. In a multi-core plan, Redis® maintains zero performance impact but with slower snapshot times.

Memory Efficiency

Despite loading both clusters with only half their available memory, Aiven for Dragonfly compresses data and consistently consumes 25% less memory than Aiven for Caching. This efficiency shines for users looking to maximize performance on resource-constrained systems or when dealing with massive datasets.

For more info about memory efficiency in Dragonfly, see Dragonfly’s Dashtable doc.

Aiven for Dragonfly vs. Aiven for Caching: The conclusion

This benchmark sheds light on the distinct strengths of Aiven for Dragonfly and Aiven for Caching, two powerful in-memory data stores.

Aiven for Dragonfly, the rising star, impresses with its raw performance and throughput. Its ability to leverage all available CPUs translates to handling millions of operations per second efficiently. This makes it a compelling choice for applications demanding high-velocity data access.

Aiven for Caching, the seasoned veteran, boasts an established reputation for exceptional latency performance. However, the new Redis licensing model raises concerns about its future and long-term impact on community collaboration.

Ultimately, the ideal contender depends on your specific needs. Consider factors like:

  • Scalability, performance requirements and workload: Dragonfly consistently impressed in our benchmarks when dealing with large amounts of data and demanding tasks.
  • Cost considerations and community support: While Redis® has a larger, well-established community, Dragonfly can be a more cost-effective option for handling big jobs.

By carefully weighing these factors, you can select the data store that empowers your application to thrive. Sign in to Aiven Console to get started with Aiven for Dragonfly or Aiven for Caching.

(*) Redis is a registered trademark of Redis Ltd. and the Redis box logo is a mark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Aiven is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Aiven.


Subscribe to the Aiven newsletter

All things open source, plus our product updates and news in a monthly newsletter.