Skip to content

Implement DiskCache using Sled #403

Description

@codeZe-us

To provide persistent caching across application restarts, a disk-based cache implementation is needed. Utilizing sled, a high-performance embedded database, this implementation will fulfill the CacheProvider contract, allowing large or persistent data to be stored efficiently on the local file system without consuming excessive RAM.

Implementation guidelines

  • Implement the CacheProvider trait for a new DiskCache struct.
  • Initialize the sled database instance with a configurable local directory path.
  • Serialize keys and values using a fast binary format (e.g., bincode) before inserting them into the sled tree.
  • Handle database locking and concurrency properly as expected in an asynchronous context.

Files location

crates/core/src/cache/disk.rs

Expected result

A reliable, persistent caching layer that survives application restarts, efficiently managing local storage using the sled embedded database.

Please make sure to use the PR template when submitting your pull request.

Join the contributor Telegram group and ask any questions: https://t.me/+sII7WPhll2liMGNk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions