-
Notifications
You must be signed in to change notification settings - Fork 7
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
Improve version #2
Comments
We need two versions per node; let's call them 1. Results from read and watch, cached valuesExample: Here, the node was set to the value In the watch change stream, readVersion and writeVersion will be identical. 2. Changes passed to writeExample: Here, the write is being performed at time This is a first step towards atomic writes (although this is not sufficient, we may need to introduce a two-phase commit protocol to the 3. Queries passed to read and watchExample: Here, the query requests nodes with a readVersion of at least 3 AND a writeVersion of at least 4. Specifying a non-zero writeVersion may result in the result skipping that node, if that node was not written since version 4. Adding a writeVersion to queries allows resume-able watch and watch-by-polling. |
In this case, there are three situations with a range of keys:
|
Currently, every node has a version value. In practice, in most (but not all) graphs and queries, all nodes have the same version. There is some redundancy here.
In subscription caches, we need to update the version number of the entire cache whenever there is a new update. With the current data structure, this takes O(size of cache) time, while other operations only take O(size of change).
It might be beneficial to rethink how version is stored and manipulated in the internal representation.
The text was updated successfully, but these errors were encountered: