Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crafting Nebulex v2 #68

Merged
merged 17 commits into from
Jul 5, 2020
Merged

Crafting Nebulex v2 #68

merged 17 commits into from
Jul 5, 2020

Conversation

cabol
Copy link
Owner

@cabol cabol commented Mar 29, 2020

SoW for Nebulex v2.0.0-rc.0

  • Refactor the Cache API
    • Remove :return option from the Cache API.
    • Remove :version option from the Cache API.
    • Refactor callback c:set/3 -> c:put/3.
    • Refactor callback c:set_many/2 -> c:put_all/2.
    • Refactor callbacks c:add/3 and c:add!/3 -> c:put_new/3, c:put_new!/3.
    • Remove callback c: add_or_replace/3.
    • Refactor callback c:update_counter/3 -> c:incr/3.
    • Remove callback c:object_info/2.
    • Add callbacks: c:ttl/1, c:touch/1.
  • Remove most of the compile-time options for the adapters; they can be set by configuration now.
  • Add an adapter metadata parameter to pass the configured options in runtime.
  • Add registry process for retrieving the adapter's metadata; using :persistent_term internally.
  • Add dynamic cache support, same as dynamic repositories in Ecto.
  • Declarative annotation-based caching via decorators.
    • Replace Nebulex.Caching.Decorators by Nebulex.Caching.
    • Replace cache/3 decorator by cacheable/3.
    • Replace evict/3 decorator by cache_evict/3.
    • Replace update/3 decorator by cache_put/3.
    • Improve the :match to return a specific value to cache (term -> boolean | {true, term}) – If true the code-block evaluation result is cached as it is (the default). If {true, value} is returned, then the value is what is cached.
  • Remove the current pre/post hooks feature. Since v2.0.0, pre/post hooks are not supported by Nebulex itself, since hooks are not a common use-case and also it is something that can be be easily implemented on top of the Cache at the application level.
  • Refactor Nebulex.Hook to implement hook decorators (before/3, after_return/3, around/3) and keep backward compatibility somehow.
  • Make the dependencies optional for more flexibility and loading only needed ones
  • Local adapter improvements
    • Make options available by configuration (only :adapter option in compile-time).
    • Make the backend configurable and support :ets and :shards.
    • Fix the adapter to manage two generations only, since two are more than enough to cover most of the use cases (maybe all).
    • Use the :persistent_term to manage the generations' lifecycle (use atoms as values for better usage of the :persistent_term).
    • Support cache limits by memory (consumed memory by the cache) and size (number of cached entries).
  • Partitioned adapter improvements
    • Make options available by configuration (only :adapter option in compile-time).
    • Only the partitioned cache module needed for starting the cache. The primary store (local cache) is loaded as part of the partitioned cache supervision tree.
  • Replicated adapter improvements
    • Make options available by configuration (only :adapter option in compile-time).
    • Only the replicated cache module needed for starting the cache. The primary store (local cache) is loaded as part of the replicated cache supervision tree.
  • Multi-level adapter improvements
    • Make options available by configuration (only :adapter option in compile-time).
    • Only the multi-level cache module needed for starting the cache along with the levels. The levels are loaded as part of the multi-level cache supervision tree.
    • Remove the :fallback option, since it can be easily covered by the caching annotations.
  • Add stats support via Erlang Counters.
  • Add migration guide from 1.2.x to 2.0.0.
  • Add Telemetry guide to explain how to instrument Nebulex caches with Telemetry.

@cabol cabol force-pushed the v2.0.0 branch 4 times, most recently from ebb1191 to ea54fe7 Compare March 30, 2020 12:19
@github-actions
Copy link

Coverage Status

Coverage decreased (-0.7%) to 99.293% when pulling ea54fe7 on v2.0.0 into d11b468 on master.

@cabol cabol force-pushed the v2.0.0 branch 2 times, most recently from 9007dcd to aa45061 Compare April 12, 2020 14:27
@cabol cabol force-pushed the v2.0.0 branch 10 times, most recently from 1b19894 to fa7d1fb Compare May 6, 2020 14:22
@cabol cabol changed the title WIP - Refactor Cache API WIP - First draft for v2.0.0 May 11, 2020
@cabol cabol force-pushed the v2.0.0 branch 2 times, most recently from d7b8dcb to dfd09a2 Compare May 20, 2020 15:58
@cabol cabol changed the title WIP - First draft for v2.0.0 WIP - Preparing first release candidate v2.0.0-rc.0 Jun 6, 2020
@cabol cabol force-pushed the v2.0.0 branch 2 times, most recently from a82fbc8 to 59d3f0a Compare July 4, 2020 16:53
@cabol cabol changed the title WIP - Preparing first release candidate v2.0.0-rc.0 Preparing Nebulex v2.0.0-rc.0 Jul 4, 2020
@cabol cabol changed the title Preparing Nebulex v2.0.0-rc.0 Crafting Nebulex v2 Jul 4, 2020
@cabol cabol merged commit 5d20860 into master Jul 5, 2020
@cabol cabol deleted the v2.0.0 branch July 5, 2020 09:01
@cabol cabol mentioned this pull request Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant