41
submitted 14 hours ago* (last edited 9 hours ago) by papercache@programming.dev to c/rust@programming.dev

Hi everyone, I recently created an in-memory cache in Rust called PaperCache. It's the first in-memory cache that's able to switch between any eviction policy at runtime, allowing it to reduce its miss ratio by adapting to changing workloads. Currently, it supports the following eviction policies:

  • LFU
  • FIFO
  • CLOCK
  • SIEVE
  • LRU
  • MRU
  • 2Q
  • ARC
  • S3-FIFO

It typically has lower tail latencies than Redis (though with the trade-off of higher memory overhead as it needs to maintain extra metadata to be able to switch between policies at runtime).

Feel free to check out the website (https://papercache.io/) which has documentation, a high-level article I wrote on Kudos (https://link.growkudos.com/1f039cqaqrk), or the paper from HotStorage'25 (https://dl.acm.org/doi/abs/10.1145/3736548.3737836)

Here's a direct link to the cache internals: https://github.com/PaperCache/paper-cache

In case you want to test it out, you can find installation instructions here: https://papercache.io/guide/getting-started/installation

There are clients for most of the popular programming languages (https://papercache.io/guide/usage/clients), though some may be a little unpolished (I mainly use the Rust client for my own work, so that one is kept up-to-date).

If you have any feedback, please let me know!

you are viewing a single comment's thread
view the rest of the comments
[-] unlawfulbooger 18 points 14 hours ago* (last edited 14 hours ago)

AGPL 😎

Edit: this looks pretty slick, I’ll keep it in mind next time I need a cache

[-] papercache@programming.dev 8 points 14 hours ago

Thanks, would appreciate any feedback if you end up using it!

this post was submitted on 07 Aug 2025
41 points (100.0% liked)

Rust

7219 readers
103 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS