8000 `fetch`, `obtain`, `get`, what should we use for fetching the value of a key? · foyer-rs foyer · Discussion #1023 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fetch, obtain, get, what should we use for fetching the value of a key? #1023

Discussion options

You must be logged in to vote

Hi.

In most cases, you may want to use fetch() over the other two methods. fetch() handles fetching the desired value from the remote storage and cache filling automatically, which provides the simplest API to handle all complex operations in one.

If you don't want foyer to help you fetch value from the remote storage, please use obtain(), which performs disk read deduplication to reduce disk IO and returns a miss on a hybrid cache miss.

If your system handles request deduplication and don't want to introduce any unnecessary overhead in the foyer layer (e.g. lock overhead for deduplication), get() is what you want.

In short, please consider fetch() > obtaion() > get().

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MrCroxx
Comment options

Answer selected by debajyoti-truefoundry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
2958
0