Git Product home page Git Product logo

javascript-load-balancer's Introduction

Load Balancing Simulator

This program simulates computing in a Load Balancer environment using Node JS and Socket IO. Initially built for a hackathon the above project is a great for understanding the various concepts of Distributed computing and Load Balancing.

The problem statement is as follows: there is a database that is being updated in realtime, in the records contains user action. The objective is to show realtime frequency of each action. e.g. event1: 10, event2: 2, event3: 45.

Working

There are two main components of this project

  1. Proxy nodes
  2. Worker nodes

Proxy Node

The proxy nodes acts as proxy between actual worker nodes and endpoint requests. The proxy node keeps constantly polling the database, looking for updates upon receiving several records it assigns a worker to parse data and update the count. The proxy node keeps track of worker status using a Javascript Map datastructure and if a worker node is still in proecss while new data is received, it is sent to different worker node.

Worker Node:

Worker node are used for heavy duty work that may take time to complete, in this case parsing data. Worker nodes iterate over the data records received from proxy node and parse each record for required data, finally they sum up and return results to proxy node. All communication is done using sockets and Socket IO framework.

javascript-load-balancer's People

Contributors

dev967 avatar imgbotapp 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.