Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

hirotnk/Harmonia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Building and Installing

Download, extract, and make

Harmonia quick execution

starts 5 virtual nodes on local machine:

./test/test5.sh -s

Then add a new virtual node to issue client commands:

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’

stops 5 virtual nodes on local machine:

./test/test5.sh -q

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.

7> hm_table:create_table(“Domain1”, “Tbl1”, [{"Fld1",true,true},{"Fld2",false, []}]).

Retrieve table property

8> hm_table:get_table_info(“Domain1”, “Tbl1”).
{ok,36885,[{"Fld1",true,0},{"Fld2",false,[]}]}

store data to Tbl1 in Domain1

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}

get data from Tbl1 in Domain1 with query condition Fld1 > 999

12> hm_cli:rget(“Domain1”, “Tbl1”, “Fld1 > 999”).
{ok,[[‘Domain1Tbl1’,1000,value3]]}

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/

Author

Copyright © Yoshihiro TANAKA
Written by Yoshihiro TANAKA <hirotnkg@gmail.com>

License

Apache 2.0 License
http://www.apache.org/licenses/

About

Chord DHT protocol implementation with Key/Value store features

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published