Is it possible to deploy a self-healing and scaling Redis-like key-value store that I can run in Kubernetes (or Swarm or any other automated cloud env)?
The challenges I found with Redis:
redis-trib
The above means that the following scenarios all will fail. I have a simple 3-master and 3-slave cluster. "Master A" fails, leading Kubernetes to start a new "Master A" in <1 second:
Questions:
Consul/etcd/zookeeper all work 100% peer-to-peer and self-heal (which is great), but their performance (supposedly) is far below Redis in-memory KV. They aren't built, e.g. for looking up a session with each Web API request. This is partially due to non-sharding (100% copies), partially due to disk writes.
Kafka's model (although a message queue, not a KV store) works well too (but depends on zk underneath): partitions and replicas, but essentially self-healing. I talk to one broker, it tells me where my topic ("shard") lives, I get it.
Is there any way to get that full autonomy using Redis so I can deploy in kube/swarm/cloud, or an alternative that provides similar performance with the autonomous model?
You can use the Kubernetes Redis Example which work with Redis Sentinel. In case the master fails, sentinel promotes a slave to the new master. The Replication Controller boots a new Slave Pod. Your application connects to sentinel and from that service you will get the ip of the new master.
Redis Sentinel https://redis.io/topics/sentinel
Kubernetes Example https://github.com/kubernetes/examples/tree/master/staging/storage/redis