# moka | moka-rs | Knowledge Base | Instagit

A high performance concurrent caching library for Rust

GitHub Stars: 2.4k

Repository: https://github.com/moka-rs/moka

---

## Articles

### [Moka Cache Lookup Performance: How the Lock-Free Design Achieves O(1) Speed](/moka-rs/moka/moka-cache-lookup-performance)

Discover Moka cache lookup performance advantages. Its lock-free design achieves O(1) speed with atomic operations and epoch-based memory management for sub-nanosecond read overhead.

- Tags: performance
- Published: 2026-03-07

### [Moka Weigher Closure Usage: Configuring Size-Aware Caching in Rust](/moka-rs/moka/moka-weigher-closure-usage)

Learn how to use Moka weigher closures in Rust to configure size-aware caching. Assign custom weights to entries for memory bounds instead of entry counts.

- Tags: how-to-guide
- Published: 2026-03-07

### [Moka Integration with async-std: A Complete Runtime Guide](/moka-rs/moka/moka-integration-with-async-std)

Integrate Moka's async cache with async-std easily. Learn how to leverage runtime-agnostic Futures for seamless caching in your Rust applications.

- Tags: tutorial
- Published: 2026-03-07

### [Moka Integration with Tokio: A Complete Guide to Async Caching](/moka-rs/moka/moka-integration-with-tokio)

Learn Moka integration with Tokio. Discover how to use moka::future::Cache for efficient async caching without Tokio specific dependencies. Unlock high performance.

- Tags: tutorial
- Published: 2026-03-07

### [Moka Cache Value Types Supported: Trait Bounds and Generic Constraints Explained](/moka-rs/moka/moka-cache-value-types-supported)

Explore Moka cache value types supported including trait bounds and generic constraints. Store any Clone Send Sync 'static type safely in your cache.

- Tags: documentation
- Published: 2026-03-07

### [Moka Cache Key Types Supported: Trait Bounds and Examples](/moka-rs/moka/moka-cache-key-types-supported)

Explore Moka cache key types. Moka supports Hash Eq Send Sync 'static keys without requiring Clone for efficient Rust caching.

- Tags: api-reference
- Published: 2026-03-07

### [How to Clone a Moka Cache in Rust: Thread-Safe Sharing Explained](/moka-rs/moka/how-to-clone-moka-cache)

Learn how to clone a Moka cache in Rust using simple O(1) operations. Share thread-safe cache handles efficiently without copying data.

- Tags: how-to-guide
- Published: 2026-03-07

### [When to Use Sync vs Async Moka Cache: Complete API Guide](/moka-rs/moka/when-to-use-sync-vs-async-moka-cache)

Discover when to use sync vs async Moka cache for your Rust applications. Learn how to leverage blocking or async runtimes with identical performance guarantees.

- Tags: api-reference
- Published: 2026-03-07

### [Cache-Aside Pattern with Moka: A Complete Rust Implementation Guide](/moka-rs/moka/cache-aside-pattern-with-moka)

Implement the cache-aside pattern in Rust with Moka. Learn to use get_with for single-flight data loading and thundering-herd protection during cache misses.

- Tags: how-to-guide
- Published: 2026-03-07

### [Moka Snapshot Restore Feature: Architecture and Implementation Guide](/moka-rs/moka/moka-snapshot-restore-feature)

 Explore the Moka snapshot restore feature architecture and implementation for robust cache persistence. Learn how to overcome complex challenges like timer wheel consistency and shard hashing.

- Tags: architecture
- Published: 2026-03-07

### [Moka Cache Hit Rate Statistics: Measuring Cache Performance in Real Time](/moka-rs/moka/moka-cache-hit-rate-statistics)

Discover how to calculate Moka cache hit rate statistics by combining debug counters and TinyLFU data with manual instrumentation for real time performance measurement.

- Tags: performance
- Published: 2026-03-07

### [Moka Cache Performance Tuning: Optimizing Builder Configuration for High-Concurrency Rust Workloads](/moka-rs/moka/moka-cache-performance-tuning)

Optimize Moka cache performance in Rust. Tune CacheBuilder settings for high concurrency, reducing contention and memory pressure with segmented tables, fast hashers, and aggressive housekeeping.

- Tags: performance
- Published: 2026-03-07

### [Why Moka Has No Background Threads: Zero-Cost Housekeeping Explained](/moka-rs/moka/why-no-background-threads-in-moka)

Discover why Moka has no background threads. Learn how zero-cost housekeeping on the caller's thread reduces resource usage and improves async compatibility.

- Tags: internals
- Published: 2026-03-07

### [Moka Eviction Listeners Example: Observing Cache Removals in Rust](/moka-rs/moka/moka-eviction-listeners-example)

Explore Moka eviction listeners in Rust. See how to observe cache removals for expirations, replacements, and size-based evictions with an easy-to-follow example.

- Tags: example
- Published: 2026-03-07

### [Per-Entry Expiration in Moka: Custom TTL Policies for Individual Cache Entries](/moka-rs/moka/per-entry-expiration-in-moka)

Implement per-entry expiration in Moka with custom TTL policies per key-value pair. Discover Moka's Expiry trait for flexible cache management.

- Tags: deep-dive
- Published: 2026-03-07

### [Implementing Size-Aware Eviction in Moka: A Complete Guide to Weight-Based Caching](/moka-rs/moka/implementing-size-aware-eviction-in-moka)

Learn to implement size-aware eviction in Moka with a user-defined weigher. This guide shows how to enforce byte-based capacity limits alongside count-based eviction using weight-based caching.

- Tags: how-to-guide
- Published: 2026-03-07

### [How Moka Handles Cache Size Limits: Understanding max_capacity and Eviction](/moka-rs/moka/how-does-moka-handle-cache-size-limits)

Learn how Moka handles cache size limits using max_capacity and eviction. Discover how TinyLFU or LRU algorithms manage entries when thresholds are exceeded.

- Tags: internals
- Published: 2026-03-07

### [What Eviction Policy Does Moka Use? TinyLFU and LRU Configuration](/moka-rs/moka/what-eviction-policy-does-moka-use)

Discover Moka's default TinyLFU eviction policy, combining LRU and Count-Min Sketch for optimal cache performance. Learn how to configure traditional LRU eviction.

- Tags: deep-dive
- Published: 2026-03-07

### [How to Use Moka Async Cache in Rust: The Complete Guide to Future-Aware Caching](/moka-rs/moka/how-to-use-moka-async-cache)

Learn how to use Moka async cache in Rust with this complete guide. Discover futures-aware caching with lock-free reads and per-key async locks for seamless integration with any async executor.

- Tags: how-to-guide
- Published: 2026-03-07

### [How to Use Moka Sync Cache in Rust: Thread-Safe Memory Caching](/moka-rs/moka/how-to-use-moka-sync-cache)

Learn how to use Moka Sync Cache in Rust for high-performance, thread-safe in-memory caching. Leverage lock-free structures for safe concurrent access without mutexes.

- Tags: how-to-guide
- Published: 2026-03-07

### [What is moka-rs? A Deep Dive into the High-Performance Rust Cache Library](/moka-rs/moka/what-is-moka-rs)

Discover moka-rs, a high-performance Rust cache library. Learn how this thread-safe solution with TinyLFU and LRU policies accelerates your applications.

- Tags: deep-dive
- Published: 2026-03-07

