// the find
elixir-nebulex/nebulex
In-memory and distributed caching toolkit for Elixir.
Nebulex is a caching abstraction layer for Elixir, modeled after Ecto's adapter pattern. You define a cache module backed by a swappable adapter (local ETS, Redis, Memcached, etc.) and get a consistent API plus declarative decorator-based caching across all of them. Aimed at Phoenix/Ecto developers who want Spring Cache-style annotations without vendor lock-in.
The decorator approach (`@decorate cacheable(...)`, `cache_put`, `cache_evict`) is genuinely clean — cache logic stays out of business logic without macros that feel hacky. The adapter abstraction is properly designed: adapters live in separate packages, so the core stays thin. The `references:` option on `cacheable` lets a secondary-key lookup (e.g., by username) point at the primary-key cache entry instead of duplicating the value — a subtle feature most caching libraries miss. Telemetry integration is first-class, not bolted on; `mix test.ci` runs credo, dialyzer, coverage, and tests together which keeps quality high.
The core package only ships a `Nil` adapter — you must pull in `nebulex_local` or a third-party adapter separately, which adds friction for first-time setup and means adapter quality varies across the ecosystem. Distributed cache topologies are documented but the actual distributed adapters (partitioned, replicated) are in separate repos with their own release cycles, so 'distributed caching toolkit' is more aspirational than batteries-included. The generational GC for local cache (creating a new 'generation' every N hours) is an unusual eviction model that surprises people expecting LRU — it effectively doubles memory usage at generation boundaries. The v3.0 migration was a breaking API change significant enough to warrant a full upgrade guide, which signals the API hasn't fully stabilized.