facebook/cachelib

Pluggable in-process caching engine to build and scale high performance services

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 17 minutes ago
Added to GitGenius on August 8th, 2026
Created on November 22nd, 2019
Open Issues & Pull Requests: 21 (+0)
Number of forks: 321
Total Stargazers: 1,580 (+0)
Total Subscribers: 51 (+0)

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 32 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • build (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 6.2 days
Mean response time: 82.8 days
90th percentile: 390.4 days
Tracked items: 51

Most active contributors

Detailed Description

CacheLib is a C++ library developed by Facebook that provides an in-process caching engine designed to build and scale high-performance services. The library offers a thread-safe API for constructing high-throughput, low-overhead caching services with transparent support for both DRAM and SSD caching mechanisms. As a pluggable caching solution, CacheLib enables developers to integrate sophisticated caching capabilities directly into their applications without requiring separate cache infrastructure.

The core functionality of CacheLib centers on delivering high-performance caching with minimal overhead. The library abstracts away the complexity of managing multiple storage tiers, allowing applications to leverage both fast DRAM and larger SSD storage transparently. This dual-tier approach enables services to balance performance requirements with capacity constraints, making it suitable for scenarios where working sets exceed available memory but performance remains critical.

CacheLib includes CacheBench, a standalone executable designed for performance evaluation and stress testing. CacheBench allows developers to benchmark caching heuristics and evaluate performance across different hardware platforms using production workloads. This tool serves dual purposes: it enables assessment of caching strategies against real-world scenarios and helps catch correctness and performance issues in CacheLib implementations and design changes. The benchmarking capability makes it valuable for teams optimizing cache behavior for their specific use cases.

The project maintains a single version number defined in CacheVersion.h that must be incremented when incompatible changes are introduced. Incompatible changes include those that cause compilation failures through public API removal or require cache drops. A changelog documents compatibility information whenever the version number increases, helping users understand the impact of updates.

Building CacheLib uses the getdeps.py script, a tool employed across multiple Meta open-source projects. This script automates dependency management by downloading and building necessary libraries with appropriate versions. The build system requires Python 3.6 or higher and handles dependencies including Boost compiled with C++14 support and GoogleTest for testing. Users can install system dependencies beforehand to accelerate the build process or allow getdeps.py to build them automatically. The build output includes executables like cachebench, libraries, headers, and sample test configurations installed to a scratch directory.

CacheLib is distributed under the Apache license, making it freely available for both open-source and commercial use. The project accepts contributions through a formal contribution guide, welcoming community involvement in improving the library. Security issues are handled through Facebook's Whitehat Bug Bounty program rather than public GitHub issues, ensuring responsible disclosure of vulnerabilities.

The repository demonstrates active maintenance with build status tracking across multiple operating systems. Users encountering build failures on their target OS can reference recent releases or check open issues and pull requests for known workarounds. The comprehensive documentation available at cachelib.org provides detailed guides for users and developers working with the library.

cachelib
by
facebookfacebook/cachelib

Repository Details

Fetching additional details & charts...