https://github.com/psiace/breve
In-memory cache implementation with Uno as the admission policy and S3-FIFO as the eviction policy
https://github.com/psiace/breve
Last synced: over 1 year ago
JSON representation
In-memory cache implementation with Uno as the admission policy and S3-FIFO as the eviction policy
- Host: GitHub
- URL: https://github.com/psiace/breve
- Owner: PsiACE
- License: apache-2.0
- Created: 2025-03-12T16:21:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T16:21:39.000Z (over 1 year ago)
- Last Synced: 2025-03-12T16:45:44.721Z (over 1 year ago)
- Language: Rust
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Breve
Breve is a cache implementation that combines lightweight machine learning with efficient eviction strategies. It uses Uno as the admission policy and [S3-FIFO](https://s3fifo.com/) as the eviction policy. This project is inspired by [TinyUFO](https://github.com/cloudflare/pingora/tree/main/tinyufo) (Cloudflare) and builds upon its foundation with significant improvements.
## Key Features
- **Lightweight Machine Learning**: Utilizes the Uno algorithm for cache admission decisions, employing a simple linear regression model to predict item access value
- **Efficient Eviction Strategy**: Based on an improved version of S3-FIFO, optimizing cache hit rates through separated queues and access counting
- **Concurrency Safety**: Thread-safe implementation using atomic operations and lock-free data structures
- **Memory Efficiency**: Offers both compact and fast storage backends to suit different needs
## Core Components
### Uno Admission Policy (by [PsiACE](https://github.com/PsiACE))
Uno is a lightweight machine learning algorithm designed to predict the access value of cache items. It consists of two main components:
- **UnoSketch**: A Count-Min Sketch based implementation for estimating item access frequency and reuse distance
- **UnoLearner**: A simple linear regression model that optimizes prediction accuracy through online learning
### S3-FIFO Eviction Policy
S3-FIFO is an efficient cache eviction algorithm, which Breve enhances with the following improvements:
- Separates cache into small and large queues for better handling of different access patterns
- Uses access counting to optimize eviction decisions
- Supports weight-aware cache management
## Why "Breve"?
> There are a lot of really good caching libraries named in relation to coffee, so I chose to use Breve.
> Although I have been having two cappuccinos a day for the last few days.
Breve is particularly well-suited for:
- High-concurrency cache systems
- Applications with strict memory efficiency requirements
- Scenarios requiring adaptive cache strategies
## License
Breve is licensed under the [Apache 2.0](./LICENSE) License. Same as TinyUFO.