Redis Cluster Re-Implemented in Rust: Scaling Redis Easily in Kubernetes
github.com
github.com
Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
https://github.com/fastio/1store
It's built using Seastar, which is sort of an ugh but cool unholy marriage of node.js and C++14 with an event loop per thread, and message passing between threads. It predates C++20 coroutines I guess, so you pass callbacks around like in Node using C++ lambdas. Maybe they have updated that by now.
They have also done a version of memcached using DPDK. I don't see a Pedis one, but check out their memcached one (scroll down): http://seastar.io/
That seems like a lot of work just to badly recreate Erlang. (Which, yes, doesn’t let you define your own native data structures in-and-of-itself — but there’s always NIFs, e.g. https://blog.discord.com/using-rust-to-scale-elixir-for-11-m....)
You are including proxies for clients and server? How do they compare to envoy? eg: Are you doing anything clever to handle failovers transparently for clients?
Is the metadata storage just using redis?
The core idea here is called chunk: https://github.com/doyoubi/undermoon/blob/master/docs/chunk....
Each proxy always runs in front of 2 Redis instances. Each chunk consists of 2 proxies and thus 4 Redis instances on 2 different physical servers. And each Redis has its master/replica on another half part under another proxy inside the chunk. So master and replica are always not in the same physical server. Chunk is the smallest building block of a cluster so the Redis instances number is always a multiple of 4.
We designed it in this way because we came up with an algorithm to balance the overall workload based on this chunk structure: https://github.com/doyoubi/undermoon/blob/master/docs/chunk_...
For the second question, the proxy here is just a way to add additional features on the top of Redis without changing its source code. I would say it's a server-side proxy while envoy focuses on the client-side features.
And yes, it can handle failover transparently for clients.
In Kubernetes, the metadata is stored inside a ConfigMap, which is based on etcd.
This allow scaling without impacting the consistency guarantees of redis !