Running Multithreaded Redis using KeyDB and Dynomite

Keys is the default oss standard for K/V store for many use cases and solutions. When you need run low latency, high throughput IN Memory Persistence - Dynomite is your solution. I always wanted to have multi-thread support in redis like Memcached has. Now someone made it and call it KeyDB. The best thing is the fact that this is done supporting the redis RESP protocol, so all your tools, scripts and code using redis protocol directly still works. Another killer feature in KeyDB is the support for FLASH storage, only available on Redis Enterprise. KeyDB also supports backup to S3. For this post, I will show how to build and run KeyDB which is dead simple and also how to use it with Dynomite like it was Redis.





KeyDB Benchmarks

As you can see on the KeyDB benchmarks, KeyDB does 1.5x less latency and 50% more throughput. These numbers are pretty impressive. The best part is the fact that is all transparent.

Running KeyDB

Download and Install

git clone https://github.com/diegopacheco/KeyDB.git
cd KeyDB
make
./keydb-server

using with redis-cli

echo "set x 10" | redis-cli
echo "get x" | redis-cli
view raw keydb-redis.md hosted with ❤ by GitHub

Running KeyDB with Dynomite

Donwload and Install Dynomite

#
# Install Dynomite
#
sudo yum install git -y
sudo yum install -y autoconf automake
sudo yum install -y libtool
sudo yum install -y openssl-devel
git clone https://github.com/Netflix/dynomite.git
cd dynomite
autoreconf -fvi
./configure --enable-debug=log
make
src/dynomite -h

cd ~/dynomite
touch keydb_as_redis_single.yml

echo "
dyn_o_mite:
  dyn_listen: 127.0.0.1:8101
  data_store: 0
  listen: 127.0.0.1:8102
  dyn_seed_provider: simple_provider
  servers:
  - 127.0.0.1:6379:1
  tokens: 437425602
" >> keydb_as_redis_single.yml

Download and install redis(only for the redis-cli)

#
# Install Redis
#

# YUM
sudo apt install redis-server

# Ubuntu
sudo yum install redis

#
# Stop Redis Server
#
sudo service redis stop

Download and install KeyDB

#
# Build and un KeyDB
#
git clone https://github.com/diegopacheco/KeyDB.git
cd KeyDB
make
./keydb-server

Run Doynomite

#
# Run Dynomite (other tab)
#
src/dynomite -c keydb_as_redis_single.yml

Access via redis-cli

echo "set x 10" | redis-cli -p 8102
echo "get x" | redis-cli -p 8102


See the Results

KeyDB running


Dynomite Running


redis-cli(via dynomite port 8102)


Other Dynomite related Posts

Cheers,
Diego Pacheco

Popular posts from this blog

Having fun with Zig Language

C Unit Testing with Check

Cool Retro Terminal