Dragonfly, a project that claims to be the faster replacement for Redis and Memcached

The news was released that the first version is already available in-memory data caching system Dragonfly, which provides support for the Memcached and Redis protocols, but it allows queries to run with much higher performance and less memory consumption.

The system handles data in key/value format and can be used as a lightweight solution to speed up heavily loaded sites, cache slow queries in the DBMS, and cache intermediate data in RAM.

The BSL was proposed by the co-founders of MySQL as an alternative to the Open Core model. The essence of BSL is that the extended functionality code is initially available for modification, but for some time it can be used for free only subject to additional conditions, which require the purchase of a commercial license to bypass.

The additional license terms of the Dragonfly project require that the code be converted to the Apache 2.0 license only on June 1, 2027. Until that time, the license allows the use of the code only to ensure the operation of its services and products, but prohibits use to create paid cloud services that act as an add-on to Dragonfly.

Dragonfly claims to be the world's fastest memory storage system, according to developers and benchmarks. Compared to Redis, Dragonfly achieved a 25x performance increase and a 3x reduction in memory consumption under typical workloads. A single Dragonfly server can process millions of requests per second, for example, in an Amazon EC2 c6gn.16xlarge environment, a throughput of 3,8 million requests per second was achieved.

In 5GB storage tests, Dragonfly required 30% less memory than Redis. During the creation of snapshots using the "bgsave" command, the memory consumption increases, but at peak times it is maintained almost three times less than in Redis, and the snapshot write operation itself is much faster (in the test, wrote a snapshot in Dragonfly in 30 seconds, and Redis - in 42 seconds).

High performance is achieved thanks to a multi-threaded architecture no shared resources ( shared-nothing ), which implies that a separate and independent controller with its own piece of data is attached to each thread, working without mutexes or spin-locks. Lightweight VLL locks are used to ensure atomicity when dealing with multiple keys. To store information efficiently in memory, the dashtable structure is used, which implements a kind of partitioned hash tables.

Of the functions available in the first version highlights support for the RESP2 protocol and 130 Redis commands, which roughly corresponds to the functionality of the Redis 2.8 release.

In addition, Dragonfly supports all Memcached commands except CAS (verify and set), provides support for asynchronous operations to create snapshots, provides predictable memory consumption, provides a built-in Lua 5.4 interpreter, and supports complex data types such as hashes, sets, and lists (ZSET, HSET, LIST, SETS, and STRING).

Separately, a caching mode is available, in which old data is automatically replaced by new data once free memory is exhausted. It is possible to link to the data for life during which the data is considered relevant.

Storage state can be flushed to disk in the background for later recovery after a reboot. To manage the system, an HTTP console (binds to TCP port 6379) and an API to return Prometheus-compliant metrics are provided. In future releases, we plan to expand support for Redis commands and implement the ability to replicate storage for failover and load balancing.

Finally, if you are interested in learning more about it, you should know that the Dragonfly code is written in C/C++ and is distributed under the BSL license (Business Source License).

You can consult about the project In the following link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.