Git Product home page Git Product logo

c-load-balancer-using-lists-hashtables's Introduction

Load Balancer for Distributed Key-Value Store

I implemented a load balancer in the 2nd semester of university with personal variants of data structures, such as: linked lists, circular lists and hash tables. It distributes key-value pairs across multiple servers and retrieves values from the appropriate server.

Functionality

The load balancer provides the following functionality:

  • Store key-value pairs
  • Retrieve values for a given key
  • Add new servers to the load balancer
  • Remove existing servers from the load balancer

How to Use

To use the load balancer, call the apply_requests function and pass it an input file. The input file should contain requests, one per line, in the following format:

  • "store" followed by a key-value pair in quotes
  • "retrieve" followed by a key in quotes
  • "add_server" followed by a server id (integer)
  • "remove_server" followed by a server id (integer)

Example

For example, the input file:

store "key1" "value1" <br>
store "key2" "value2" <br>
retrieve "key1" <br>
add_server 1 <br>
store "key3" "value3" <br>
remove_server 1 <br>
retrieve "key3" <br>

will produce the following output:

Stored value1 on server 0. <br>
Stored value2 on server 1. <br>
Retrieved value1 from server 0. <br>
Stored value3 on server 2. <br>
Key key3 not present. <br>

Compiling and Running

To compile the program, run the following command:
make

To run the program, use the following command:
./load-balancer input-file

c-load-balancer-using-lists-hashtables's People

Contributors

eduardspirache avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.