Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how does K3S support the watch mechanism under K8S after using Sqlite3? #102

Closed
jamesxia20181001 opened this issue Mar 1, 2019 · 6 comments

Comments

@jamesxia20181001
Copy link

Does Sqlite3 support a watch mechanism similar to etcd? If Sqlite3 does not support the watch mechanism itself, how does K3S support the watch mechanism under K8S after using Sqlite3? Thank you!

@ibuildthecloud
Copy link
Contributor

sqlite3 is fully in memory so it quite simple to know when something has changed. So we just monitor all mutations and fire events. Additionally the way the data is stored in sqlite is effectively a log which is how we can replay history. Full code here. It's really quite simple https://github.com/ibuildthecloud/kvsql/tree/master/clientv3/driver

@jamesxia20181001
Copy link
Author

Since sqlite3 does not support HA, etcd needs 3 nodes. Can you replace etcd or sqlite3 with postgresql, provide master/slave HA with 2 nodes, and implement the watch mechanism? Thank you!

@xiaosuiba
Copy link

There's a distributed relational database built on SQLite - rqlite.

@jamesxia20181001
Copy link
Author

Rqlite uses Raft to achieve consensus across all the instances of the SQLite databases. This means that at least 3 nodes are needed, and HA is not available at 2 nodes.

@ibuildthecloud
Copy link
Contributor

@jamesxia20181001 We will eventually support postgresql and/or mysql for a datastore. Right now we do not because there are other issues with HA that prevent it from fully working properly.

@hunknownz
Copy link

It's kine.

@k3s-io k3s-io locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants