Harmonia
Chord DHT protocol implementation with Key/Value store features
Install / Use
/learn @hirotnk/HarmoniaREADME
h2. About Harmonia
Harmonia is a distributed storage engine based on Chord DHT algorithm. It provides range query function over DHT storage layer. It stores data with replication.
N.B. Now, it is in alpha quality.
Paper: "dissertation paper on Harmonia":https://github.com/hirotnk/Harmonia/blob/master/doc/Dissertation_Harmonia_12_2010.pdf
h2. Building and Installing
Download, extract, and make
h2. Harmonia quick execution
starts 5 virtual nodes on local machine:
<pre>./test/test5.sh -s</pre>Then add a new virtual node to issue client commands:
<pre>erl -pa ebin -config harmonia -run hm_edge start -harmonia node_type 'join' name xxx sname 'xxx_node@ubu' root_node 'node_foo@ubu' -setcookie harmonia_cookie -sname 'xxx_node@ubu'</pre>stops 5 virtual nodes on local machine:
<pre>./test/test5.sh -q</pre>h2. Harmonia API example
create table as domain name is Domain1, table name is Tbl1, field names Fld1 and Fld2, etc, it returns node name on which table and its replicas were created.
<pre>7> hm_table:create_table("Domain1", "Tbl1", [{"Fld1",true,true},{"Fld2",false, []}]).</pre>Retrieve table property
<pre>8> hm_table:get_table_info("Domain1", "Tbl1"). {ok,36885,[{"Fld1",true,0},{"Fld2",false,[]}]}</pre>store data to Tbl1 in Domain1
<pre>9> hm_cli:rstore("Domain1", "Tbl1", [{"Fld1", 1},{"Fld2", value1}]). {ok,4} 10> hm_cli:rstore("Domain1", "Tbl1", [{"Fld1", 100},{"Fld2", value2}]). {ok,4} 11> hm_cli:rstore("Domain1", "Tbl1", [{"Fld1", 1000},{"Fld2", value3}]). {ok,4}</pre>get data from Tbl1 in Domain1 with query condition Fld1 > 999
<pre>12> hm_cli:rget("Domain1", "Tbl1", "Fld1 > 999"). {ok,[['Domain1Tbl1',1000,value3]]}</pre>h2. Algorithm
Harmonia is based on Chord algorithm, and it builds index on top of that, hence provides range query function. Ref: "http://pdos.csail.mit.edu/chord/":http://pdos.csail.mit.edu/chord/
h2. Author
Copyright (C) Yoshihiro TANAKA Written by Yoshihiro TANAKA hirotnkg@gmail.com
h2. License
Apache 2.0 License "http://www.apache.org/licenses/":http://www.apache.org/licenses/
