Better HN
topnewbestaskshowjobs
Log inSign up

doyoubi

52 karma · joined May 3, 2020 (6y ago) · 9 submissions

Submissions

comment 5y ago · link · parent

Tendis focuses more on persistence and it uses decentralized architecture just as Redis Cluster.

comment 5y ago · link · parent

I have to admit the diagram is a bit misleading.

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.

comment 5y ago · link · parent

Yes! It uses exactly the same slot model in the official Redis Cluster. Each key will first calculate its slot number by a hashing function. Then try to find out the instance with this corresponding slot. So this solution is compatible with the existing Redis Cluster clients from the community.

comment 5y ago · link · parent

Cool! Thanks for sharing.

comment 5y ago · link · parent

Nop. It's that a better solution would still be using multiple Redis instances on each physical server. Trying to support multi-threads in the storage engine requires complex synchronization implementation. Sharing nothing between each small instance achieves higher performance and is a lot simpler. Also, FULL SYNC between masters and replicas can be uncontrollable. And smaller memory size for each instance alleviates the performance impact from FULL SYNC.

comment 5y ago · link · parent

Redis 6 has already supported multiple threads for IO. The memory storage engine is still inside a single thread but I think it's fine.

comment 5y ago · link · parent

Yes, that's accurate. This project runs on top of Redis as Redis has already done a good job as a memory storage engine. And https://github.com/doyoubi/undermoon-operator will help run it with Redis instances together, so you won't need to set them up manually. And yes, it can work with KeyDB in theory.

comment 5y ago · link · parent

Feel free to let me know if you get any questions :)

9.

Redis Cluster Re-Implemented in Rust: Scaling Redis Easily in Kubernetes(github.com ↗)

106 points · by doyoubi · 5y ago · 21 comments