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

Cache transactions' parents #1689

Closed
GalRogozinski opened this issue Dec 16, 2019 · 1 comment
Closed

Cache transactions' parents #1689

GalRogozinski opened this issue Dec 16, 2019 · 1 comment
Assignees
Labels

Comments

@GalRogozinski
Copy link
Member

@GalRogozinski GalRogozinski commented Dec 16, 2019

Description

Cache the Branch Approvee and the Trunk approvees (the transaction parents)

Motivation

We want to cache data that helps us easily retrieve the parents for either validation or walks

Requirements

We need to create the appropriate ViewModels before persisting to cache.
There should be an eviction policy similar to the TVM’s eviction policy. Evicted items should be weakly referenced.
We are handling immutable data here, so there is no concept of dirty
Before attempting to read data from the DB it must be first read from cache.
Flush to db upon shutdown

Implementation suggestions

Instead of performing getSaveBatch and then tangle.saveBatch go via the ViewModels. This way we can relevant caches.
The problem with this solution is that it will disable us from using the writeBatch feature of RocksDb…
As far as I can see, we will only be able to solve this problem after we refactor the DB.

Open Questions (optional)

Should we take this opportunity to cache anything else?

Blocked By: #1673

@GalRogozinski

This comment has been minimized.

Copy link
Member Author

@GalRogozinski GalRogozinski commented Feb 13, 2020

Fixed by #1697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.