Microsoft open sourced Garnet storage compatible with Redis

Microsoft has open sourced the NoSQL system Garnet, designed for creating caching stores and compatible with existing client libraries for Redis storage. Garnet supports the creation of scalable data caching clusters that can use replication, key migration, and data sharding across cluster nodes. The project is written in C# with a storage core in C++, is open under the MIT license and can run on all platforms supported by .NET (the primary platforms are Linux and Windows).

To store data, the Tsavorite engine (a fork of Microsoft FASTER storage) is used, which supports multi-threaded query processing, transactions, fixing changes in a non-blocking mode (checkpointing), recovery from failures, saving redundant copies and maintaining a log of operations. The network engine in Garnet is built using the shared memory architecture proposed by the ShadowFax research project. TLS processing and interaction with storage are performed in a single thread, which makes it possible to avoid the overhead of switching threads and more efficiently use the CPU cache when transferring data over the network.

The Garnet architecture separates the logic for parsing and processing requests from storage operations. Data is stored using two key-value stores based on the Tsavorite library. The first "main" store is optimized for fast string operations, and the second "object" store is optimized to accommodate complex objects and advanced data types such as hashes and lists. The data types in the second storage are implemented using .NET libraries. Data is stored on the heap (C# heap), which allows it to be updated efficiently, and in serialized form on disk.

Microsoft open sourced Garnet storage compatible with Redis

Features of Garnet:

  • It is possible to deploy multi-tiered storage, spanning RAM, SSD drives and cloud storage, in which less-in-demand data is pushed into slow storage to create caches larger than RAM.
  • Extensible device support, allowing the creation of layers optimized to work with different devices, for example, there are layers for SDD, hard drives and Azure Storage cloud storage.
  • An efficient mechanism for reusing freed space in RAM, preventing fragmentation.
  • Configurable limits on the size of memory used for indexes, logs and object storage.
  • The RESP protocol is used to access the storage, which allows Garnet to be used with unmodified Redis clients.
  • Supports storing both string values ​​and complex data structures such as lists, hashes, sets, sorted lists, and geolocation data. Ability to determine key lifetime.
  • Availability of APIs for performing analytical queries (HLL/Hyperloglog, Bitmap), transactions (MULTI/EXEC) and using the publish/subscribe paradigm.
  • Availability of means for flexible access control via ACL.
  • Ability to define configuration in JSON or redis.conf format.
  • Support for connecting additional network handlers. Ability to encrypt traffic using TLS (based on SslStream).
  • The ability to create extensions in C# that implement additional operations with strings and objects.
  • Support for transactional stored procedures spanning multiple keys.
  • Ability to restore state from a previously saved position (checkpoint-recovery). The presence of an append-only file mode (AOF, append-only file), in which all old data remains available and is not replaced.
  • Support for creating a storage cluster with replication, sharding, dynamic key migration between nodes and recovery of failed nodes.
  • High performance and low latency when executing queries. Efficiently process small batch requests over a large number of client sessions, allowing you to achieve throughput (number of processed requests per second) an order of magnitude higher than competing solutions. When running in virtual machines in the Azure cloud, in most cases, client latency does not exceed 300 microseconds. In our tests, Garnet is significantly ahead of Redis, Dragonfly and KeyDB in terms of performance and responsiveness. In some tests, Garnet outperforms competing systems by up to ten times.
    Microsoft open sourced Garnet storage compatible with Redis
    Microsoft open sourced Garnet storage compatible with Redis
    Microsoft open sourced Garnet storage compatible with Redis
    Microsoft open sourced Garnet storage compatible with Redis

Source: opennet.ru

Add a comment