Helium

A Distributed Key Value Store

Download as .zip Download as .tar.gz View on GitHub

Helium - A Distributed Key Value Store

Helium is a Distributed Key Value store. This is a Course project which I developed while taking Distributed Systems course. The purpose of this project is to learn Distributed Systems in a Hands On way.

Following are the salient features of the Helium

Design

Replication

Following figure shows how keys are distributed among coordinator and replicas -

alt tag

Handling Node Failures and Joins

Following figure shows a scenario when a machine C1 fails and the actions taken by other machines alt tag

Following figure shows a scenario when a new machine C5 joins and the actions taken by other machines alt tag

Concurrency

Membership Protocol

Each host runs a Failure Detector process. This implements a gossip based membership protocol which is used to keep track of live hosts in the system. Gossip based protocol is very scalable for large number of machines. For n nodes, each node needs to transmit only log(n) gossip messages. So this is a very bandwidth efficient and fault tolerant scheme.

Distributed Grep

Debugging distributed applications can be very tricky and therefore I developed a distributed Grep tool that can be used to grep the logs of multiple Key Value servers from a single machine -

Following diagram illustrates the steps involved in processing a Grep command. The numbers on arrows indicate the order of events.

alt tag

Project Structure

Directory Organization

Helium            - Base Directory  
Helium/src      - Source Code  
Helium/lib      - Jar files of the dependencies and helium.jar (containing class files for Helium project)  
Helium/config   - Configuration Files  
Helium/logs     - Log files  
Helium/scripts  - Scripts for starting the Key Value Server and Client  

Requirements

Compiling the code

The following instructions will work fine for any Linux distribution

        $ cd Helium
        $ ant

This will compile the source code and create the output jar file helium.jar in lib folder.

Configuration

config/app.config contains configuration parameters. Set the following parameters as per your test setup.

Running the code

scripts folder contains scripts for running the starting the HeliumServer and HeliumClient

HeliumServer

    $ ./heliumserver.start.sh

This will start the HeliumServer and bring up a command line interface to interact with HeliumServer.

HeliumClient