• Stars
    star
    292
  • Rank 142,152 (Top 3 %)
  • Language
    Erlang
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Partitioned ETS tables for Erlang and Elixir

Shards

ETS tables on steroids!

Sharding for ETS tables out-of-box.

CI Codecov Hex Version Docs License

Why might we need Sharding/Partitioning for the ETS tables? The main reason is to keep the lock contention under control enabling ETS tables to scale out and support higher levels of concurrency without lock issues; specially write-locks, which most of the cases might cause significant performance degradation.

Therefore, one of the most common and proven strategies to deal with these problems is Sharding or Partitioning; the principle is pretty similar to DHTs.

This is where shards comes in. Shards is an Erlang/Elixir library fully compatible with the ETS API, but it implements sharding or partitioning on top of the ETS tables, completely transparent and out-of-box.

See the getting started guide and the online documentation.

Installation

Erlang

In your rebar.config:

{deps, [
  {shards, "1.1.0"}
]}.

Elixir

In your mix.exs:

def deps do
  [{:shards, "~> 1.1"}]
end

For more information and examples, see the getting started guide.

Important links

  • Blog Post - Transparent and out-of-box sharding support for ETS tables in Erlang/Elixir.

  • Projects using shards:

    • shards_dist - Distributed version of shards. It was moved to a separate repo since v1.0.0.
    • Nebulex – Distributed Caching framework for Elixir.
    • ExShards – Elixir wrapper for shards; with extra and nicer functions.
    • KVX – Simple Elixir in-memory Key/Value Store using shards (default adapter).
    • Cacherl Distributed Cache using shards.

Testing

$ make test

You can find tests results in _build/test/logs, and coverage in _build/test/cover.

NOTE: shards comes with a helper Makefile, but it is just a simple wrapper on top of rebar3, therefore, you can do everything using rebar3 directly as well (e.g.: rebar3 do ct, cover).

Generating Edoc

$ make docs

NOTE: Once you run the previous command, you will find the generated HTML documentation within doc folder; open doc/index.html.

Contributing

Contributions to shards are very welcome and appreciated!

Use the issue tracker for bug reports or feature requests. Open a pull request when you are ready to contribute.

When submitting a pull request you should not update the CHANGELOG.md, and also make sure you test your changes thoroughly, include unit tests alongside new or changed code.

Before to submit a PR it is highly recommended to run make check before and ensure all checks run successfully.

Copyright and License

Copyright (c) 2016 Carlos Andres Bolaños R.A.

Shards source code is licensed under the MIT License.

More Repositories

1

nebulex

In-memory and distributed caching toolkit for Elixir.
Elixir
1,088
star
2

erlbus

Simple, Distributed and Scalable PubSub Message Bus written in Erlang
Erlang
233
star
3

kvx

Simple in-memory Key/Value Store written in Elixir using `cabol/ex_shards`
Elixir
99
star
4

west

WEST (Web/Event-driven Systems Tool) is another messaging tool written in Erlang, that enables the building of messaging-based systems
Erlang
43
star
5

ex_shards

Elixir wrapper for cabol/shards .
Elixir
39
star
6

nebulex_ecto

Nebulex and Ecto integration
Elixir
27
star
7

nebulex_examples

Nebulex Examples
Elixir
26
star
8

nebulex_redis_adapter

Nebulex adapter for Redis
Elixir
23
star
9

gen_buffer

A generic message buffer behaviour with pooling and back-pressure for Erlang/Elixir.
Erlang
16
star
10

jchash

Jump Consistent Hash NIF library for Erlang/Elixir
Erlang
15
star
11

cross_db

Simple and flexible database wrapper for Erlang
Erlang
10
star
12

oauth2_mnesia_backend

Mnesia backend for kivra/oauth2 project.
Erlang
7
star
13

dberl

NoSQL DB access tool written in Erlang.
Erlang
6
star
14

tcp_client

An Erlang TCP client connections manager
Erlang
5
star
15

nebulex_cluster

Cluster utilities for Nebulex adapters like Redis or Memcached
Elixir
4
star
16

erlang_adt

Abstract Data Types Examples In Erlang
Erlang
3
star
17

rps

Rock-Paper-Scissors Example using Phoenix Framework
Elixir
3
star
18

nebulex_adapters_cachex

A Nebulex adapter for Cachex
Elixir
3
star
19

oauth2_dberl_backend

dberl backend for kivra/oauth2 project.
Erlang
2
star
20

shards_bench

Performance tests for cabol/shards project.
Erlang
2
star
21

cross_db_couchbase

Couchbase adapter for cabol/cross_db
1
star
22

shards_kv

Simple in-memory KV store using cabol/shards.
1
star
23

nebulex_memcached_adapter

Nebulex adapter for Memcached
Elixir
1
star
24

phoenix_oauth2_example

OAuth2 example using Phoenix and kivra/oauth2
1
star
25

shards_pg

Erlang PG2 implementation using shards!
1
star
26

nebulex_adapters_partitioned

Nebulex adapter for partitioned cache topology
1
star
27

shards_dist

Distributed implementation for Shards
1
star
28

cabol.github.io

Blog
CSS
1
star
29

nebulex_mnesia_adapter

Nebulex adapter for Mnesia
1
star