Replies: 4 comments 2 replies
-
I am asking this because rqlite does not have a webhook capability as is. Therefore for near-realtime updates, polling is the only option. But it is expensive. |
Beta Was this translation helpful? Give feedback.
-
https://rqlite.io/docs/faq/#can-i-read-the-sqlite-file-directly Yes, you can do it, and you should see the updates to the database. But I've not tested it that much. If I was to implement a webhook, what would that webhook do? In response to what type of changes? What's your use case for them? |
Beta Was this translation helpful? Give feedback.
-
Hi, The use case is about a distributed cron/task scheduler. There are some tasks that needs to be run once per cluster while some needs to be run per instance. In order to eliminate another worker election on application level, it was easier to poll the nodes and status of the rqlite, choose the leader as worker, so the task would be run only once by the leader node. The application data in the database are controlled by the application itself. The only near-realtime change is on the worker election. It is easier to ask "who is the leader" and assign the worker node as the RAFT elected leader. However, this is so specific to this use case, I cannot imagine any other uses of this. |
Beta Was this translation helpful? Give feedback.
-
You mean the "leadership" status? No that cannot be read by querying the SQLite database. The SQLite database only stores whatever data you put into it. Of course, that can always be changed, but would require coding. |
Beta Was this translation helpful? Give feedback.
-
I need to monitor some values, yet polling in intervals of the values if they are changed or not is time and resource consuming. Is it okay to read from the SQLite database directly? Any possible issues about data consistency or "unknown unkns" for users?
Beta Was this translation helpful? Give feedback.
All reactions