Writing a concurrent LRU cache

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Caffeine

    A high performance caching library for Java

    Ya, I saw concache but I looked into it and it doesn't implement what is needed. Each bucket has its own linked-list backing (hence "lock-free linked list buckets"). An LRU needs each value in each bucket to be part of one linked list I believe. After posting this I realized my line of research was failing because it was state of the art five years ago. Caffeine replaced `concurrentlinkedhashmap` in the java world (by the same author). A rust version of that is Moka. These are much more complicated than a concurrent LRU but faster (aka more state of the art). Another rust crate is Stretto which is a port of dgraph's Ristretto (in go). The question becomes is it worth it to essentially port `concurrentlinkedhashmap` to have a great concurrent LRU when there are more state of the art caches out there.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. concurrentlinkedhashmap

    A ConcurrentLinkedHashMap for Java

    Part 1 makes sense, 2 is a little confusing. The blog post ends up using this Java library: https://github.com/ben-manes/concurrentlinkedhashmap which implements those ideas. I am curious if there is something equivalent implemented in rust, or is it something I should write? Also is there an even better way to do thread-safe performant LRU?

  4. concache

    A linked-list based, lock-free concurrent hashmap in Rust.

    Concache ( https://github.com/saligrama/concache ) is the only crate that came up easily in a search, but I don't know whether it would be easily adaptable if it needed tweaks. You might could try forking it anyway.

  5. moka

    A high performance concurrent caching library for Rust

    Ya, I saw concache but I looked into it and it doesn't implement what is needed. Each bucket has its own linked-list backing (hence "lock-free linked list buckets"). An LRU needs each value in each bucket to be part of one linked list I believe. After posting this I realized my line of research was failing because it was state of the art five years ago. Caffeine replaced `concurrentlinkedhashmap` in the java world (by the same author). A rust version of that is Moka. These are much more complicated than a concurrent LRU but faster (aka more state of the art). Another rust crate is Stretto which is a port of dgraph's Ristretto (in go). The question becomes is it worth it to essentially port `concurrentlinkedhashmap` to have a great concurrent LRU when there are more state of the art caches out there.

  6. stretto

    Stretto is a Rust implementation for Dgraph's ristretto (https://github.com/dgraph-io/ristretto). A high performance memory-bound Rust cache. (by al8n)

    Ya, I saw concache but I looked into it and it doesn't implement what is needed. Each bucket has its own linked-list backing (hence "lock-free linked list buckets"). An LRU needs each value in each bucket to be part of one linked list I believe. After posting this I realized my line of research was failing because it was state of the art five years ago. Caffeine replaced `concurrentlinkedhashmap` in the java world (by the same author). A rust version of that is Moka. These are much more complicated than a concurrent LRU but faster (aka more state of the art). Another rust crate is Stretto which is a port of dgraph's Ristretto (in go). The question becomes is it worth it to essentially port `concurrentlinkedhashmap` to have a great concurrent LRU when there are more state of the art caches out there.

  7. ristretto

    A high performance memory-bound Go cache

    Ya, I saw concache but I looked into it and it doesn't implement what is needed. Each bucket has its own linked-list backing (hence "lock-free linked list buckets"). An LRU needs each value in each bucket to be part of one linked list I believe. After posting this I realized my line of research was failing because it was state of the art five years ago. Caffeine replaced `concurrentlinkedhashmap` in the java world (by the same author). A rust version of that is Moka. These are much more complicated than a concurrent LRU but faster (aka more state of the art). Another rust crate is Stretto which is a port of dgraph's Ristretto (in go). The question becomes is it worth it to essentially port `concurrentlinkedhashmap` to have a great concurrent LRU when there are more state of the art caches out there.

  8. dashmap

    Blazing fast concurrent HashMap for Rust.

    Some additional notes are in this slide deck and the implementation javadoc. You'd probably want to use something like DashMap for the hash table.

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. evlru

    An eventually consistent LRU designed for lock-free concurrent reads

  11. left-right

    A lock-free, read-optimized, concurrency primitive.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Python deserves a good in-memory cache library!

    7 projects | /r/Python | 8 Feb 2023
  • FusionCache v2.1 – Production-ready implementation of Microsoft HybridCache

    1 project | news.ycombinator.com | 5 Feb 2025
  • FusionCache v2.0

    1 project | news.ycombinator.com | 5 Feb 2025
  • Show HN: Whirlwind – Async concurrent hashmap for Rust

    6 projects | news.ycombinator.com | 5 Nov 2024
  • FusionCache: A Net Cache Implementation

    1 project | news.ycombinator.com | 23 Jun 2024

Did you know that Rust is
the 5th most popular programming language
based on number of references?