Dragonfly, a RAM data caching system

Dragonfly

Dragonfly is an in-memory data store built for modern application workloads.

A few days ago it was announced release of the Dragonfly in-memory caching and data storage system, which manipulates data in key/value format and can be used as a lightweight solution for speeding up high-load sites by caching slow queries to the DBMS and intermediate data in RAM.

Dragonfly supports Memcached and Redis protocols, allowing you to use existing client libraries and port projects using Memcached and Redis to Dragonfly without having to rework your code.

It is worth mentioning that Dragonfly recently received an update, reaching its version 1.0 and in which stands out for the implementation of support for data replication from primary to secondary server.

At the same time, Dragonfly can be configured to be used as secondary storage which accepts data from the main server based on Dragonfly and Redis. The replication management API is compatible with Redis and is based on the use of the ROLE and REPLICAOF (SLAVEOF) commands.

About Dragonfly

High performance is achieved thanks to a multi-threaded architecture without sharing resources (shared-nothing), which means that a separate controller is attached to each thread with its own piece of data, which works without mutexes or spin-locks.

Lightweight VLL locks are used to guarantee atomicity when dealing with multiple keys, since to store the information efficiently in memory, the dashtable structure is used, which implements a kind of partitioned hash tables.

Compared to Redis, Dragonfly boasts a 25x performance boost (3,8 million requests per second) under typical workloads in an Amazon EC2 c6gn.16xlarge environment. Compared to Memcached in an AWS c6gn.16xlarge environment, Dragonfly was able to complete 4,7 times more write requests per second (3,8 million vs. 806k) and 1,77 times more read requests per second (3,7 million vs. 2,1 million).

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

Some Dragonfly features are:

  • A caching mode that automatically replaces old data with new data once free memory is depleted.
  • Support for data binding lifecycles during which data is considered up to date.
  • Support for flushing storage state to disk in the background for later recovery after a reboot.
  • The presence of an HTTP console (binds on TCP port 6379) for system management and an API for returning metrics, compatible with Prometheus.
  • Support for 185 Redis commands, roughly equivalent to the functionality of the Redis 5 release.
  • Support for all Memcached commands except CAS (verify and configure).
  • Support for asynchronous operations to create snapshots.
  • Predictable memory consumption.
  • Integrated Lua interpreter 5.4.
  • Support for complex data types such as hashes, sets, lists (ZSET, HSET, LIST, SETS, and STRING), and JSON data.
  • Storage replication support for failover and load balancing.

For those interested in the Dragonfly code, you should know that this is written in C/C++ and is distributed under the license BSL .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 Dragonfly project's additional license terms require that the code be migrated to the Apache License 2.0 on March 15, 2028. Until then, the license permits 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 a plug-in to Dragonfly.

Finally if you are interested in knowing a little more about it, you can check the details 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.