gitmyhub

KeyDB

C++ ★ 12k updated 2y ago

A Multithreaded Fork of Redis

KeyDB is a drop-in replacement for Redis that adds multi-threading so it can handle significantly more requests per second on the same hardware, while staying fully compatible with all existing Redis commands, scripts, and clients.

C++setup: moderatecomplexity 3/5

KeyDB is a modified version of Redis, a widely used in-memory data store that applications use to cache information and handle fast lookups. The core change KeyDB makes is adding multithreading: where Redis processes requests one at a time on a single thread, KeyDB can process many requests at once across multiple CPU cores. According to the README's benchmark charts, this allows KeyDB to handle significantly more operations per second on the same hardware.

Because KeyDB keeps full compatibility with the Redis protocol, commands, modules, and scripts, it is designed to work as a drop-in replacement. An application using Redis can switch to KeyDB without changing any code. Features like atomic transactions and scripts behave the same way.

KeyDB adds several capabilities that go beyond Redis. Active Replication lets two KeyDB instances stay in sync while both accept reads and writes at the same time, which simplifies certain high-availability setups. FLASH Storage allows data that does not fit in RAM to spill over to a local SSD. Subkey Expires lets you set expiry times on individual fields inside a data structure, not just on a whole key. The MVCC architecture (a way of managing concurrent reads and writes) means expensive commands like full key scans do not block other operations.

The project is maintained by Snap Inc. (the company behind Snapchat), which uses KeyDB internally as part of its caching infrastructure. There is no separate commercial product and no paid support. The README links to community Slack, a forum, and GitHub issues for help.

Configuration is handled through the same style of file Redis uses, with a few new options added to control thread count, client balancing across threads, and S3 backup.

Where it fits