All Projects → whitfin → Cachex

whitfin / Cachex

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

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Cachex

Hazelcast
Open-source distributed computation and storage platform
Stars: ✭ 4,662 (+373.3%)
Mutual labels:  caching, distributed-systems
Scrapbook
PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APC(u), SQL and additional capabilities (e.g. transactions, stampede protection) built on top.
Stars: ✭ 279 (-71.68%)
Mutual labels:  transactions, caching
Nact
nact ⇒ node.js + actors ⇒ your services have never been so µ
Stars: ✭ 848 (-13.91%)
Mutual labels:  distributed-systems
Aten
An adaptive accrual node failure detection library for Elixir and Erlang
Stars: ✭ 31 (-96.85%)
Mutual labels:  distributed-systems
Awesome Scalability
The Patterns of Scalable, Reliable, and Performant Large-Scale Systems
Stars: ✭ 36,688 (+3624.67%)
Mutual labels:  distributed-systems
Rw File Cache
🗄️ PHP File-based Caching Library
Stars: ✭ 10 (-98.98%)
Mutual labels:  caching
Openagent
An agent library for systems of nested automata.
Stars: ✭ 28 (-97.16%)
Mutual labels:  distributed-systems
Trek
Trek is a CLI/ncurses explorer for HashiCorp Nomad clusters.
Stars: ✭ 26 (-97.36%)
Mutual labels:  distributed-systems
Orleans
Orleans is a cross-platform framework for building distributed applications with .NET
Stars: ✭ 8,131 (+725.48%)
Mutual labels:  distributed-systems
Go Queue
Multi backend queues for Golang
Stars: ✭ 15 (-98.48%)
Mutual labels:  distributed-systems
Akkeeper
An easy way to deploy your Akka services to a distributed environment.
Stars: ✭ 30 (-96.95%)
Mutual labels:  distributed-systems
Lasp
Prototype implementation of Lasp in Erlang.
Stars: ✭ 876 (-11.07%)
Mutual labels:  distributed-systems
Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (-12.89%)
Mutual labels:  caching
Docker Airflow
Repo for building docker based airflow image. Containers support multiple features like writing logs to local or S3 folder and Initializing GCP while container booting. https://abhioncbr.github.io/docker-airflow/
Stars: ✭ 29 (-97.06%)
Mutual labels:  distributed-systems
Ddia
《Designing Data-Intensive Application》DDIA中文翻译
Stars: ✭ 10,458 (+961.73%)
Mutual labels:  distributed-systems
Rememberable
Query caching for Laravel
Stars: ✭ 960 (-2.54%)
Mutual labels:  caching
Vearch
A distributed system for embedding-based retrieval
Stars: ✭ 940 (-4.57%)
Mutual labels:  distributed-systems
Awesome Microservices Netcore
💎 A collection of awesome training series, articles, videos, books, courses, sample projects, and tools for Microservices in .NET Core
Stars: ✭ 865 (-12.18%)
Mutual labels:  distributed-systems
Cryptoinscriber
📈 A live cryptocurrency historical trade data blotter. Download live historical trade data from any cryptoexchange, be it for machine learning, backtesting/visualizing trading strategies or for Quantopian/Zipline.
Stars: ✭ 27 (-97.26%)
Mutual labels:  transactions
Clusteredbigcache
golang bigcache with clustering as a library.
Stars: ✭ 37 (-96.24%)
Mutual labels:  caching

Cachex

Build Status Coverage Status Hex.pm Version Documentation

Cachex is an extremely fast in-memory key/value store with support for many useful features:

  • Time-based key expirations
  • Maximum size protection
  • Pre/post execution hooks
  • Proactive/reactive cache warming
  • Transactions and row locking
  • Asynchronous write operations
  • Distribution across app nodes
  • Syncing to a local filesystem
  • Idomatic cache streaming
  • Batched write operations
  • User command invocation
  • Statistics gathering

All of these features are optional and are off by default so you can pick and choose those you wish to enable.

Table of Contents

Installation

As of v0.8.0, Cachex is available on Hex. You can install the package via:

  1. Add cachex to your list of dependencies in mix.exs:
def deps do
  [{:cachex, "~> 3.3"}]
end
  1. Ensure cachex is started before your application:
def application do
  [applications: [:cachex]]
end

Usage

In the most typical use of Cachex, you only need to add your cache as a child of your application. If you created your project via Mix (passing the --sup flag) this is handled in lib/my_app/application.ex. This file will already contain an empty list of children to add to your application - simply add entries for your cache to this list:

children = [
  {Cachex, name: :my_cache_name}
]

If you are using Elixir versions prior to Elixir v1.5, you are able to use the older syntax:

children = [
  supervisor(Cachex, name: :my_cache)
]

If you wish to start a cache manually (for example, in iex), you can just use Cachex.start_link/2:

Cachex.start_link(name: :my_cache)

For anything else, please see the documentation.

Benchmarks

There are some very trivial benchmarks available using Benchee in the benchmarks/ directory. You can run the benchmarks using the following command:

# default benchmarks, no modifiers
$ mix bench

# enable underlying table compression
$ CACHEX_BENCH_COMPRESS=true mix bench

# use a state instead of a cache name
$ CACHEX_BENCH_STATE=true mix bench

# use a lock write context for all writes
$ CACHEX_BENCH_TRANSACTIONS=true mix bench

Any combination of these environment variables is also possible, to allow you to test and benchmark your specific workflows.

Contributions

If you feel something can be improved, or have any questions about certain behaviours or pieces of implementation, please feel free to file an issue. Proposed changes should be taken to issues before any PRs to avoid wasting time on code which might not be merged upstream.

If you do make changes to the codebase, please make sure you test your changes thoroughly, and include any unit tests alongside new or changed behaviours. Cachex currently uses the excellent excoveralls to track code coverage.

$ mix test # --exclude=distributed to skip slower tests
$ mix credo
$ mix coveralls
$ mix coveralls.html && open cover/excoveralls.html
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].