All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
v3.0.2 (2026-03-07)
- Added
usage-rules/folder to the Hex package for agent-assisted development workflows. - Fixed CI workflow: split Hex/Rebar install from dependency fetching,
improved PLT cache key to include Elixir/OTP versions and
mix.lockhash, fixed dialyzer step to run regardless of PLT cache status, and bumped GitHub Actions to v4.
v3.0.1 (2026-03-01)
- [Nebulex.Event.CacheEntryEvent] Forward per-command
:telemetry_metadataas:extra_metadatawithin the event's:metadatamap. This allows event listeners to inspect metadata markers without disabling telemetry entirely. Themetadatatype is now always a map (previouslykeyword() | map()). #253. - [Nebulex] Add "Installation" section to the main module docs
clarifying that adapter dependencies (e.g.,
:nebulex_local) must be added explicitly inmix.exs. - [Nebulex] Improve main module docs structure: rename "Caches" to "Usage" and add "What's next" section linking all guides in a logical learning progression.
- [Nebulex.Cache.Options] Remove misleading
default: falsefrom the runtime:telemetryoption schema. The actual default comes from the cache's global:telemetrysetting inadapter_meta, not the option schema.
v3.0.0 (2026-02-21)
- [Nebulex.Caching.Decorators] Decorator-invoked cache operations
(
cacheable,cache_put,cache_evict) now automatically inject the:decorator_contextinto the:telemetry_metadataoption. This enables telemetry handlers to identify which decorated function triggered each cache operation. The:decorator_contextmap includes:decorator,:module,:function_name, and:arity. #251. - [Nebulex.Caching.Decorators] The
cache_evictdecorator now properly passesoptsthrough all eviction paths (delete,delete_all), ensuring telemetry metadata propagates consistently. - [Nebulex.Adapter] The
:telemetry_metadataand:telemetry_eventoptions are now extracted fromoptsbefore passing them to the adapter callback, keeping adapter args clean. - [Nebulex.Caching.Decorators] Added
:transactionoption to wrap decorated function execution and cache operations in a cache transaction. When set totrue, the decorator locks the specified cache keys for the duration of the transaction, preventing concurrent processes from accessing or modifying them simultaneously. The transaction intelligently determines which keys to lock based on the decorator options (e.g.,key: {:in, keys},:query, or generated keys). This feature helps prevent race conditions, cache stampede, and inconsistent updates in concurrent environments. The:transactionoption can be configured both at the module level (use Nebulex.Caching) and at the decorator level, with decorator-level settings overriding module-level defaults. #248. - [Nebulex.Adapters.Coherent] Added new coherent cache adapter to
nebulex_distributed. The coherent adapter provides a "local cache with distributed invalidation" pattern where each node maintains its own independent local cache, but writes trigger invalidation events across the cluster viaNebulex.Streams. Key features include maximum read performance (pure local lookups), distributed invalidation via Phoenix.PubSub, and a write-invalidate protocol that minimizes network overhead by only broadcasting invalidation events. Ideal for read-heavy workloads, configuration/reference data caching, and session caches. - [Documentation] Overall documentation improvements.
- [Nebulex.Adapter.Transaction] The default transaction implementation has been
removed from the core Nebulex library. Each adapter is now responsible for
providing its own transaction implementation tailored to its specific needs.
This change keeps the core library more generic and allows adapters to
optimize transaction handling for their particular use cases (e.g., local
ETS-based locking for single-node caches vs. distributed locking for
multi-node setups). Adapters that support transactions must implement
the
Nebulex.Adapter.Transactionbehaviour independently. #249.
v3.0.0-rc.2 (2025-12-07)
- [Nebulex.Cache] Added
:telemetryoption as a shared command option, allowing selective override of the global telemetry setting on a per-command basis without needing to start separate cache instances. - [Nebulex.Cache] Added
fetch_or_storecallback to the Cache API. For more information, see: #240. - [Nebulex.Cache] Added
get_or_storecallback to the Cache API. For more information, see: #241. - [Nebulex.Caching.Decorators] The
cache_evictdecorator now supports a:queryoption for bulk eviction based on adapter-specific queries. For example:@decorate cache_evict(query: my_query). The query can be provided directly or as a function that returns the query at runtime. Additionally, both:queryand:keyoptions can be used together to evict specific entries and entries matching a query pattern in a single operation. When both are provided, query-based eviction executes first, followed by key-based eviction. For more information, see: #243. #245. - [Nebulex.Caching.Decorator] Add support for evicting external references in
cache_evictdecorator. For more information, see: #244. - [Documentation] Added comprehensive "Declarative Caching" guide
(
guides/learning/declarative-caching.md) showcasing patterns, best practices, and real-world examples for using caching decorators. The guide includes progressive learning with an e-commerce scenario covering basic decorator usage, advanced eviction patterns (including the new combined:keyand:queryfeature),Nebulex.Adapters.Localfeatures (QueryHelper, tagging, references), testing strategies, and common pitfalls. Replaces ad-hoc examples previously scattered in API documentation. #246.
v3.0.0-rc.1 (2025-05-01)
- [Nebulex.Cache] New ok/error tuple API for all cache functions.
- [Nebulex.Cache] Alternative cache trailing bang (
!) functions. - [Nebulex.Cache] All cache commands (in addition to
c:get_dynamic_cache/0,c:put_dynamic_cache/1, andc:with_dynamic_cache/2) optionally support passing the desired dynamic cache (name or PID) as the first argument to interact directly with a cache instance. - [Nebulex.Cache] A "Query Spec" has been added and must be used for all Query API calls.
- [Nebulex.Cache] Added fetch callbacks:
c:Nebulex.Cache.fetch/2,3andc:Nebulex.Cache.fetch!/2,3. - [Nebulex.Cache]
c:Nebulex.Cache.get/3semantics changed a bit. Previously, returnednilwhen the given key wasn't in the cache. Now, the callback accepts an argument to specify the default value when the key is not found (defaults tonil). - [Nebulex.Cache] Any Elixir term, including
nil, can be stored in the cache. Any meaning or semantics behindnil(or any other term) is up to the user. - [Nebulex.Cache]
Nebulex.Cachenow emits Telemetry span events for each cache command (without depending on the adapters). - [Nebulex.Cache] Option
:bypass_modehas been added toc:Nebulex.Cache.start_link/1for bypassing the cache by overwriting the configured adapter withNebulex.Adapters.Nilwhen the cache starts. This option is handy for tests if you want to disable or bypass the cache while running them. - [Nebulex.Cache] Added "Info API" to get information about the cache. For example: memory, stats, etc.
- [Nebulex.Cache] Added "Observable" API to maintain a registry of listeners and invoke them to handle cache events.
- [Nebulex.Caching.Decorators] Option
:cachesupports a cache module, a dynamic cache, and an anonymous function to resolve the cache at runtime. - [Nebulex.Caching.Decorators] Option
:key, in addition to a compilation-time term, supports a tuple{:in, keys}to specify a list of keys, and an anonymous function to resolve the key at runtime. - [Nebulex.Caching.Decorators] Option
:referencessupports dynamic caches. - [Nebulex.Caching.Decorators] Option
:referencescan now receive a TTL. (e.g.,references: &keyref(&1.id, ttl: :timer.seconds(10))). - [Nebulex.Caching.Decorators] Handle possible inconsistencies when using references, leveraging the match function. See "match function on references" for more information.
- [Nebulex.Caching] The following option can be provided when using
use Nebulex.Caching(instead of adding them to every single decorated function)::cache,:on_error,:match, and:opts.
- [Nebulex.Cache]
c:Nebulex.Cache.all/2has been removed. Please usec:Nebulex.Cache.get_all/2instead (e.g.,MyCache.get_all(query: query_supported_by_the_adapter)). - [Nebulex.Cache]
c:Nebulex.Cache.get_all/2belongs to the Query API and receives a "query spec" (e.g.,MyCache.get_all(in: [...])). - [Nebulex.Caching.Decorators] The
:cacheoption doesn't support MFA tuples anymore. Please use an anonymous function instead (e.g.,cache: &MyApp.Caching.get_cache/1). - [Nebulex.Caching.Decorators] Option
:keysis no longer supported. Please use the option:keyinstead (e.g.,key: {:in, keys}). - [Nebulex.Caching.Decorators] Option
:key_generatoris no longer supported on the decorators. Please use the option:keyinstead (e.g.,key: &MyApp.Caching.compute_key/1). - [Nebulex.Caching] The
Nebulex.Caching.KeyGeneratorbehaviour has been removed. Please use the:default_key_generatoroption with an anonymous function instead (must be provided in the format&Mod.fun/arity). Besides, the:default_key_generatoroption must be provided touse Nebulex.Caching. (e.g.,use Nebulex.Caching, default_key_generator: &MyApp.generate_key/1). - [Nebulex.Adapter.Stats]
Nebulex.Adapter.Statsbehaviour has been removed. Therefore,c:Nebulex.Cache.stats/0andc:Nebulex.Cache.dispatch_stats/1are no longer supported. Please useNebulex.Adapter.Infoinstead. - [Nebulex.Adapter.Persistence]
Nebulex.Adapter.Persistencebehaviour has been removed. Therefore,c:Nebulex.Cache.dump/2andc:Nebulex.Cache.load/2are no longer supported.
- [Nebulex.Adapter.Info]
Nebulex.Adapter.Infoadapter behaviour has been added to handle cache information and stats (optional). - [Nebulex.Adapter.Observable]
Nebulex.Adapter.Observableadapter behaviour has been added to maintain a registry of listeners and invoke them to handle cache events (optional). - [Nebulex.Adapters.Local] The adapter
Nebulex.Adapters.Localhas been moved to a separate repository. - [Nebulex.Adapters.Partitioned] The adapter
Nebulex.Adapters.Partitionedhas been moved to a separate repository. - [Nebulex.Adapters.Multilevel] The adapter
Nebulex.Adapters.Multilevelhas been moved to a separate repository. - [Nebulex.Adapters.Replicated] The adapter
Nebulex.Adapters.Replicatedhas been moved to a separate repository (WIP).
- Nebulex
v3.0.0-rc.1roadmap #189
- See the CHANGELOG.md in the v2 branch