[erlang-questions] [ANN] Tansu - An Erlang Raft based KV and lock store

Peter Morgan peter.james.morgan@REDACTED
Mon May 9 12:48:14 CEST 2016


Hello -

Tansu is a distributed key/value store designed to maintain configuration and other data that must be highly available. It uses the Raft consensus algorithm for leadership and distribution of state amongst its members. Node discovery is via mDNS and will automatically form a mesh of nodes sharing the same environment. It provides a simple REST based KV and lock API.

Tansu is available as a Docker image - starting a 5 node cluster is as simple as:

for i in {1..5}; do 
    docker run \
        --name tansu-$(printf %03d $i) \
        -d shortishly/tansu;
done

Setting a value with a TTL of 10 seconds on a random node:

curl \
    -H "Content-Type: application/json" \
    -H "ttl: 10" \
    -i \
    http://$(docker inspect \
        --format={{.NetworkSettings.IPAddress}} \
        tansu-$(printf %03d $[1 + $[RANDOM % 5]]))/api/keys/hello \
    --data-binary '{"ephemeral": true}'

Getting a value from a random node:

curl \
    -i \
    -s \
    http://$(docker inspect \
            --format={{.NetworkSettings.IPAddress}} \
            tansu-$(printf %03d $[1 + $[RANDOM % 5]]))/api/keys/hello

Locks, event streams and more details are available at https://github.com/shortishly/tansu.

Thanks,
Peter.


More information about the erlang-questions mailing list