Ristretto is a fast, concurrent cache library built with a focus on performance and correctness. It all started with needing a memory-bound, concurrent Go cache in Dgraph. We looked around for a solution, but we couldn’t find a great one. We then tried using a sharded map, with shard eviction to release memory, which caused us memory issues. We then repurposed Groupcache’s LRU, using mutex locks for thread safety. After having it around for a year, we noticed that the cache suffered from severe contention. A commit to remove that cache caused our query latency to dramatically improve by 5-10x. In essence, our cache was slowing us down! We concluded that the concurrent cache story in Go is broken and must be fixed. In March, we wrote about the State of Caching in Go, mentioning the problem of databases and systems requiring a smart memory-bound cache which can scale to the multi-threaded environment Go programs find themselves in.

Features

  • High Hit Ratios
  • Eviction: SampledLFU
  • Cost-Based Eviction
  • Fast Throughput
  • Fully Concurrent
  • Simple API

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

Apache License V2.0

Follow Ristretto

Ristretto Web Site

Other Useful Business Software
AI-based, Comprehensive Service Management for Businesses and IT Providers Icon
AI-based, Comprehensive Service Management for Businesses and IT Providers

Modular solutions for change management, asset management and more

ChangeGear provides IT staff with the functions required to manage everything from ticketing to incident, change and asset management and more. ChangeGear includes a virtual agent, self-service portals and AI-based features to support analyst and end user productivity.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Ristretto!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-11