-
Notifications
You must be signed in to change notification settings - Fork 22
[Feature Request] Ability to query history for an entry. #30
Comments
@vaultec81 sounds compelling! Would you get what you needed by simple listing out the events in the log that pertain to that index? |
@aphelionz Yes, that would work. |
If you want to attempt a PR I would suggest then modifying / extending the Index.updateIndex function to encapsulate that somehow. It should actually be fairly straightforward in the reduce call, and bonus points if you keep it backwards compatible :D |
@aphelionz I am curious about what is the best approach to doing a history tracking system. Should it be built into the docstore index or in Orbit-db core itself. It would be simpler to add a new function on to docstore that interfaces with the history index. There isn't any changes to the data stored itself (or Orbit-db core), so it would be backwards compatible |
IMO it should be in the docstore index for now, since other store types may or may not want the feature. |
Currently docstore Index only keeps track of whether a docstore entry exists or not and the current value coinciding to it. There could be a toggle that turns on and off the past history tracking when the store instance is created. History would contain pasts queryable values, deletion, creation. This would be essentially converting events from the oplog into a useable format.
Side note: in the future the index could only store event meta, such as add, del. Values would be stored on disk/IPFS to conserve memory. Potentially even sharded (at the cost of performance) to save space.
I am willing to submit a PR to add this feature.
The text was updated successfully, but these errors were encountered: