kubewharf / kubebrain

A High Performance Metadata System for Kubernetes
Apache License 2.0
764 stars 79 forks source link

Question: more other backends support, and native watch support #11

Closed STRRL closed 2 years ago

STRRL commented 2 years ago

I noticed that kubebrain already supported these storage "backend":

Do we have plans to support more other KvStorage backends like Redis, MongoDB, aerospike, and so on?

Another question is, many KV Databases already support WATCH API as the basic operation, should we consider the support for the native watch API?

xuchen-xiaoying commented 2 years ago

@STRRL Thanks for your discussion.

Another question is, many KV Databases already support WATCH API as the basic operation, should we consider the support for the native watch API?

  1. As far as I known, Redis , ZooKeeper , Consul and ETCD supports watch API, but Consul and Zookeeper are more likely to be service registry other than KV Databases, could you tell other KV Databases that support WATCH API?
  2. Could you explain the meaning of "native watch API" ?
xuchen-xiaoying commented 2 years ago

@STRRL

Do we have plans to support more other KvStorage backends like Redis, MongoDB, aerospike, and so on?

Currently KubeBrain has some requirements for storage engine, so not all KVStorage can be supported.

  1. Redis does't support transaction and CAS update/delete. We have thought on this before, but it may be difficult.
  2. MongoDB seems be an option after a rough thought, we will investigate on it more deep. Welcome to work together on this topic if you have any interest.
  3. Aerospike is not very familiar to us though. We will dig into it later.

FurtherMore, In these requirements, logical clock AND snapshot read may be implemented inside KubeBrain in future, rather than depends on underlying backend.

STRRL commented 2 years ago

As far as I known, Redis , ZooKeeper , Consul and ETCD supports watch API, but Consul and Zookeeper are more likely to be service registry other than KV Databases, could you tell other KV Databases that support WATCH API?

I have little knowledge in the database area, I could not list other KV Databases which supports watch API except MongoDB and Aerospike. 🤣

Could you explain the meaning of "native watch API" ?

Using the "Watch" mechanism provided by the backend KV Database instead of pkg/backend/watch.go and pkg/backend/watchhubg.go.

STRRL commented 2 years ago

@STRRL

Do we have plans to support more other KvStorage backends like Redis, MongoDB, aerospike, and so on?

Currently KubeBrain has some requirements for storage engine, so not all KVStorage can be supported.

  1. Redis does't support transaction and CAS update/delete. We have thought on this before, but it may be difficult.
  2. MongoDB seems be an option after a rough thought, we will investigate on it more deep. Welcome to work together on this topic if you have any interest.
  3. Aerospike is not very familiar to us though. We will dig into it later.

FurtherMore, In these requirements, logical clock AND snapshot read may be implemented inside KubeBrain in future, rather than depends on underlying backend.

Thanks for the explanation! ❤️

Redis does't support transaction and CAS update/delete. We have thought on this before, but it may be difficult.

IUCC, redis actually works as "serializable", maybe we could implement the txn and CAS also inside of the kubebrain. 😳 So once we could implement them, and also snapshot read inside the KubeBrain, it is possible to use redis as the backend. Is that correct?

xuchen-xiaoying commented 2 years ago

@STRRL

I could not list other KV Databases which supports watch API except MongoDB and Aerospike.

  1. Thanks for the info that MongoDB supports Watch, which make it more possible to be another backend, we will investigate on it and then give a conclusion later.
  2. Aerospike is minority compared to Mongo, I couldn't find enough documents of it. If it supports Watch, does it behave like Redis? In redis, watch may lose event.

Using the "Watch" mechanism provided by the backend KV Database instead of pkg/backend/watch.go and pkg/backend/watchhubg.go.

  1. Watch Interface of different KV Databases are different, KubeBrain should extract a common Interface for them. Now KubeBrain supports two Watch API. One is ETCD watch API, another is newly defined to satisfy need of Kubernetes. You can find in server package.
xuchen-xiaoying commented 2 years ago

@STRRL appreciate your idea.

IUCC, redis actually works as "serializable", maybe we could implement the txn and CAS also inside of the kubebrain. 😳 So once we could implement them, and also snapshot read inside the KubeBrain, it is possible to use redis as the backend. Is that correct?

If implement the txn and CAS insise KubeBrain, needs to lock to avoid conflict, which may affect the performance and introduce more complexity, we will think twice on this.

STRRL commented 2 years ago

Thanks for the explanation!