Skip to content

lursz/LoadBalancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoadBalancer

Description

The main idea behind this project is to create a Load Balancer acting as a broker between the queries and the databases. Its job is to perform CRUD operations and keep all DBs synchronized.
For SELECT operations LB will use only one databse, chosen by the suitable strategy (e.g. round robin). For INSERT/UPDATE/DELETE operations, LB will send the request to all databases, thus keeping them synchronized. Moreover, the load balancer must be able to handle all kinds of unexpected events thrown at him, including but not limited to:

  • Failure of one or multiple DBs
  • Reconnection of DBs
  • Multiple requests at the same time

Run

In order to run the project, you must have Docker (with Docker Compose) and .NET 8.0 installed on your machine.
First, you need to create the databases. You can provide your own or use Docker to create them. To do the latter, run following command in the /Docker directory:

docker-compose up

With the databases up and running, you can now run the Load Balancer. To do so, navigate to the /LoadBalancer directory and run the project

dotnet run

Design

Design of our project is depicted on the following diagram: diagram

Presented below is the initialization flow (to help understand the order of operations): Flow

Used Design Patterns

During the development of this project we have used the following design patterns:

factory3

state0

strategy1

unit_of_work

Technology stack

  • C#
  • .NET 8.0
  • NHibernate
  • Docker
  • PostgreSQL

About

DB LoadBalancer in C#, dessign patterns used: Factory method, State, Strategy, Unit of work

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages