# Ram - an in-memory distributed KV store

**URL:** <https://erlangforums.com/t/ram-an-in-memory-distributed-kv-store/845>\
**Category:** Libraries\
**Tags:** databases, ram, key-value, kv\
**Created:** [December 21, 2021, 2:28pm UTC](https://erlangforums.com/t/ram-an-in-memory-distributed-kv-store/845 "2021-12-21T14:28:37Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![dischoen](https://erlangforums.com/user_avatar/erlangforums.com/dischoen/32/695_2.png) [@dischoen](https://erlangforums.com/u/dischoen)\
**Post date:** [April 26, 2022, 9:35am UTC](https://erlangforums.com/t/ram-an-in-memory-distributed-kv-store/845/9 "2022-04-26T09:35:51Z")

</div>

Hi Roberto,

this morning I played a bit with ram, I compressed your erlang example in a CT module and  
used peer (with OTP 25 rc2) to orchestrate:

```erlang
my_test_case(_Config) ->
    NodeNames = [ram1, ram2, ram3],
    %% /tmp/all/ contains all beam and app files from 
    %% aten, gen_batch_server, ram and ra
    Args = ["-pa", "/tmp/all"],
    PidsNodes = 
        lists:map(fun(P) -> 
                          {ok, Pid, Node} = peer:start_link(#{
                                                              name => P, 
                                                              connection => standard_io,
                                                              args => Args}),
                          true = peer:call(Pid, net_kernel, connect_node, [Node]),
                          {Pid, Node}
                  end,
                  NodeNames),
    [P1,P2,P3] = [Pid || {Pid, _Node} <- PidsNodes],
    Nodes = [Node || {_Pid, Node} <- PidsNodes],
    peer:call(P1, ram, start_cluster, [Nodes]),
    peer:call(P1, ram, put, ["key", "value"]),
    "value" = peer:call(P1, ram, get, ["key"]),
    "value" = peer:call(P2, ram, get, ["key"]),
    "value" = peer:call(P3, ram, get, ["key"]),
    peer:stop(P1),
    peer:stop(P2),
    peer:stop(P3).

```

a complete repository is here: [GitHub - dischoen/rampeer: play with ram in peers](https://github.com/dischoen/rampeer).

Btw, in the documentation you use the URL “git://github.com/ostinelli/ram.git”,  
rebar3 3.18 cannot read from there.  
I replaced it with [git@github.com](mailto:git@github.com):ostinelli/ram.git

---

_[View the full topic](https://erlangforums.com/t/ram-an-in-memory-distributed-kv-store/845)._
