Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. cachex

cachex

MITElixirv4.1.1

A powerful, feature-rich in-memory key/value caching library for Elixir with support for transactions, fallbacks, and expirations.

Visit WebsiteGitHubGitHub
1.7k stars119 forks0 contributors

What is cachex?

Cachex is an in-memory key/value caching library for Elixir designed to enhance application performance by storing frequently accessed data. It solves problems like redundant computations and database load by providing a fast, feature-rich caching layer with support for expirations, transactions, and distribution. Developers use it to reduce latency and improve scalability in Elixir applications.

Target Audience

Elixir developers building high-performance, scalable applications that require efficient data caching, such as web servers, APIs, or real-time systems. It's particularly useful for teams needing advanced caching features like transactions, distribution, or proactive warming.

Value Proposition

Developers choose Cachex for its comprehensive feature set, including transactions, asynchronous writes, and node distribution, all while maintaining high speed and an idiomatic Elixir API. Its opt-in design ensures minimal overhead, making it a flexible and powerful alternative to basic caching solutions.

Overview

A powerful caching library for Elixir with support for transactions, fallbacks and expirations

Use Cases

Best For

  • Reducing database load in Elixir web applications by caching query results
  • Implementing distributed caching across multiple nodes in a cluster
  • Handling time-sensitive data with automatic expiration policies
  • Ensuring data consistency in concurrent environments with transactional support
  • Optimizing performance through proactive cache warming for predictable access patterns
  • Streaming large cache datasets efficiently using Elixir's streaming capabilities

Not Ideal For

  • Applications requiring durable, disk-backed persistence without additional configuration
  • Simple caching needs where a basic key-value store like ETS would suffice
  • Teams operating in stateless environments without distributed system requirements
  • Projects with strict memory constraints where in-memory storage is prohibitive

Pros & Cons

Pros

High Performance

The README highlights it as 'extremely fast' with benchmarks available using Benchee, including configurable tests for compressed and transactional scenarios.

Comprehensive Feature Set

Includes time-based expirations, transactions, asynchronous writes, distribution, and more, all listed as key features with examples in the advanced section.

Modular Opt-In Design

All advanced features are optional and disabled by default, allowing developers to enable only what they need without unnecessary overhead, as stated in the philosophy.

Elixir Native Integration

Supports idiomatic cache streaming and batched operations, integrating seamlessly with Elixir's concurrency model and standard libraries, as shown in the basic and advanced examples.

Cons

In-Memory Data Loss Risk

Primarily an in-memory store, so data is volatile and can be lost on application crashes unless syncing to filesystem is enabled, which requires extra setup and is not default.

Configuration Complexity

Enabling advanced features like distribution or proactive warming involves additional configuration and understanding of Elixir's distributed systems, which can be daunting for less experienced teams.

Overhead for Simple Use

For basic caching, the extensive feature set might introduce unnecessary complexity and resource usage compared to lighter alternatives like ETS, as features are opt-in but still add cognitive load.

Frequently Asked Questions

Quick Stats

Stars1,741
Forks119
Contributors0
Open Issues6
Last commit3 months ago
CreatedSince 2016

Tags

#elixir#memory-cache#caching#performance-optimization#distributed-systems#key-value-store#distributed-caching#caching-library#in-memory-store#performance

Built With

E
Elixir

Links & Resources

Website

Included in

Elixir13.1k
Auto-fetched 1 day ago

Related Projects

nebulexnebulex

In-memory and distributed caching toolkit for Elixir.

Stars1,391
Forks80
Last commit1 month ago
con_cachecon_cache

ets based key/value cache with row level isolated writes and ttl support

Stars927
Forks73
Last commit8 months ago
memoizememoize

A method caching macro for elixir using CAS on ETS.

Stars204
Forks14
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub