A unified interface to key-value stores.
Mnemonix
aims to help you:
- Get running with key-values stores with minimal ceremony
- Experiment with different key-value store backends for your application
- Allow end-users of your library liberty to choose their preferred backend
It encodes the behaviour, lifecycle, and feature set of a key-value store behind a common GenServer
interface, normalizes different store APIs to conform to that interface, polyfill stores lacking features, and exposes access to them through a familiar Map
API.
Learn more about starting a Mnemonix.Store.Server
and manipulating it with the Mnemonix
API in the documentation.
Mnemonic systems are techniques or strategies consciously used to improve memory. They help use information already stored in long-term memory to make memorization an easier task.
— Mnemonics, Wikipedia
Not to be confused with the mnemonicode library, Mnemonex
.
👍 | Continuous Integration | Test Coverage |
---|---|---|
Master | ||
Development |
Obviously, Mnemonix
gives you Map
-style functions to manipulate various key-value stores. However, Mnemonix
also offers extra features beyond simple Map functions. Stores that don't natively support these features have the capability added through an Elixir polyfill, guaranteeing you can use and switch stores without worrying about what features they support under the hood.
Available features are:
Mnemonix.Features.Map
- The key-value manipulation you know and loveMnemonix.Features.Bump
- Increment/decrement integer valuesMnemonix.Features.Expiry
- Set entries to remove themselves from the store with a ttl
-
Add
Mnemonix
to your project's dependencies in itsmix.exs
:def deps do [{:mnemonix, "~> 0.7.1"}] end
-
Ensure
Mnemonix
is started before your application:def application do [applications: [:mnemonix]] end
Pull requests are welcome and greatly appreciated!
Here are some useful commands if you've just forked the project and want to contribute:
mix deps.get
- Get development dependenciesmix test
- Run the test suitemix credo
- Run static code analysis on Elixir sourcemix dialyzer
- Run static code analysis on compiled BEAM bytecodemix docs
- Generate documentation filesmix clean
- If any of the above stop behaving as expected