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
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 upWith 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 runDesign of our project is depicted on the following diagram:

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

During the development of this project we have used the following design patterns:
C#.NET 8.0NHibernateDockerPostgreSQL



