# foyer-rs/foyer

Hybrid in-memory and disk cache in Rust

Repository: https://github.com/foyer-rs/foyer
Canonical: https://ross.abutalabs.com/products/foyer
Homepage: https://foyer-rs.github.io/foyer
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: hybrid-cache, rust, cache
Last push: 2026-08-23T16:32:05+00:00

## Health v2 (maintenance only)
Score: 85/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 67, longevity 86
- inputs: {"age_days": 1209, "days_push": 10, "days_rel": 222, "gap_med": 8.5, "n_releases_24m": 35}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1797, forks 95 (observed 2026-08-28T04:05:37.619731+00:00)

## What it is
Foyer is a Rust library providing a hybrid cache that seamlessly combines in-memory and disk caching with pluggable eviction algorithms. It offers a thread-safe, zero-copy in-memory abstraction and one-line integration with observability systems like Prometheus and OpenTelemetry.

## Use cases
- add a hybrid in-memory and disk cache to a Rust application
- cache hot data in memory and spill to disk in Rust
- replace CacheLib-style hybrid caching in a Rust project
- plug in custom eviction algorithms for a cache
- monitor cache hit rates with Prometheus metrics
- speed up a database or storage engine with a caching layer

## When to choose
- you need both memory and disk tiers in one cache API
- you want pluggable, replaceable caching algorithms
- you need high-concurrency, thread-safe caching in Rust
- you want built-in observability integrations

## When to avoid
- you only need a simple in-memory cache with no disk tier
- you are not working in Rust
- you need a distributed, networked cache rather than an embedded library

## Facets
- artifact type: library
- maturity: active
- function: caching, monitoring
- domain: databases, performance, developer-tools
- platform: rust, windows
- tags: hybrid-cache, disk-cache, in-memory-cache, thread-safe, zero-copy, prometheus, observability, linux, macos

## Member repositories
- foyer-rs/foyer (main) score 85

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:37.619731+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:22:40.915218+00:00, confidence not recorded.
  - readme: https://github.com/foyer-rs/foyer (fetched 2026-08-28T04:05:37.619731+00:00, sha 23d5901cd096)
  - homepage: https://foyer-rs.github.io/foyer (fetched 2026-08-29T11:01:20.807170+00:00, sha fc877fccb62a)
  - registry_crates: https://crates.io/api/v1/crates/foyer (fetched 2026-08-29T11:01:20.816192+00:00, sha fdf2645cf532)
- Data as of 2026-08-30T08:39:29.467469+00:00.
