Skip to content

new feature: Add cache layer for opendal #5678

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

Open
Xuanwo opened this issue Mar 1, 2025 · 5 comments · May be fixed by #5906
Open

new feature: Add cache layer for opendal #5678

Xuanwo opened this issue Mar 1, 2025 · 5 comments · May be fixed by #5906

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Mar 1, 2025

Provide high-quality built-in cache support in OpenDAL while ensuring users have the flexibility to implement their own caching logic.

@jorgehermo9
Copy link
Contributor

Hi, I would like to work on this, can I? Or is anybody willing to work on this already?

I thought about using https://github.com/foyer-rs/foyer. I see It has been already discussed here.

@Xuanwo
Copy link
Member Author

Xuanwo commented Mar 6, 2025

Hi, @jorgehermo9, that will be greatly appreciated. No one is currently working on this.


Ideally, our cache layer should enable users to design and implement their own cache algorithms while seamlessly switching between different cache crates like Foyer or Moka. However, I believe we should integrate with Foyer first to clarify our direction moving forward.

Let's first build a FoyerLayer, and later, we can extract a CacheLayer from it.

@jorgehermo9
Copy link
Contributor

jorgehermo9 commented Mar 6, 2025

I agree a lot with the plan!! Thanks @Xuanwo 😊

@jorgehermo9
Copy link
Contributor

jorgehermo9 commented Mar 23, 2025

Just as an update about this, I have the initial implementation almost finished (for read and blocking_read operations for the moment) and will submit a PR in a few days/a week, as soon as I can 😄

@Xuanwo
Copy link
Member Author

Xuanwo commented Apr 17, 2025

I have an idea that our future CacheLayer can accept an Operator instead. Take foyer as an example, we can implement a foyer service. And use it like:

let cache_op = Operator::from_config(FoyerConfig::default).finish()?;
let op = op.layer(CacheLayer::new(cache_op));

We will need a benchmark to evaluate their performance.

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

Successfully merging a pull request may close this issue.

2 participants