Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

[Feature Request] Ability to query history for an entry. #30

Open
vaultec81 opened this issue Oct 23, 2019 · 5 comments
Open

[Feature Request] Ability to query history for an entry. #30

vaultec81 opened this issue Oct 23, 2019 · 5 comments

Comments

@vaultec81
Copy link

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.

@aphelionz
Copy link
Contributor

@vaultec81 sounds compelling! Would you get what you needed by simple listing out the events in the log that pertain to that index?

@vaultec81
Copy link
Author

@aphelionz Yes, that would work.

@aphelionz
Copy link
Contributor

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

@vaultec81 vaultec81 reopened this Oct 27, 2019
@vaultec81
Copy link
Author

@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

@aphelionz
Copy link
Contributor

IMO it should be in the docstore index for now, since other store types may or may not want the feature.

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

2 participants