bincache
bincache is a versatile, high-performance, async-first binary data caching library for Rust, designed with a focus on flexibility, efficiency, and ease of use. It enables developers to store, retrieve, and manage binary data using various caching strategies, catering to different storage needs and optimization requirements.
The library offers several caching strategies out of the box:
- Memory: This strategy stores all the data directly in memory. It is ideal for smaller sets of data that need to be accessed frequently and quickly.
- Disk: This strategy saves data exclusively to disk storage. It is best suited for large data sets that don't need to be accessed as often or as swiftly.
- Hybrid: This strategy is a combination of memory and disk storage. It stores data in memory first, and swaps to disk for files that don't fit the memory limit.
We also offer opt-in support for data compression:
- zstd: Enabled using the
comp_zstdfeature flag. - more to come...
This crate is intended to be versatile, serving as an efficient solution whether you're developing a high-load system that needs to reduce database pressure, an application that requires quick access to binary data, or any other situation where efficient caching strategies are vital.
Usage
Add bincache to your Cargo.toml dependencies:
Examples
Getting started quickly using ready-made aliased cache builders:
use MemoryCacheBuilder;
#
# async
More advanced usage, using the builder directly:
use ;
#
# async
License
bincache is licensed under the MIT license.