Skip to content

A comprehensive example project illustrating the implementation of horizontal scaling and load balancing for web applications using YARP.

License

Notifications You must be signed in to change notification settings

hvaezapp/load-balancing-with-yarp

Repository files navigation

Load Balancing with YARP

This repository presents a comprehensive example project that demonstrates how to implement horizontal scaling and efficient load balancing for ASP.NET Core web applications using YARP (Yet Another Reverse Proxy). The solution includes containerized API instances running with Docker, leveraging Dapper for lightweight and performant data access with PostgreSQL as the database backend. This setup enables seamless distribution of client requests across multiple service instances, ensuring high availability and scalability in modern microservices architectures.

🚀 Project Overview

  • ASP.NET Core Web API (Minimal API): A lightweight and high-performance RESTful API built using ASP.NET Core Minimal APIs, designed for simplicity and efficiency.
  • Dapper: A lightweight Object-Relational Mapper (ORM) that provides fast and simple data access.
  • PostgreSQL: A powerful, open-source relational database system used as the backend data store.
  • Docker: Containerization technology for creating consistent and portable application environments.
  • YARP: Yet Another Reverse Proxy, used to efficiently distribute incoming traffic across multiple API instances for load balancing and scalability.

🛠️ Prerequisites

Ensure you have the following installed:

  • .NET SDK (version 9.0)
  • Docker Desktop

📦 Project Setup

  1. Clone the Repository

    git clone https://github.com/hvaezapp/load-balancing-with-yarp.git
    cd load-balancing-yarp
    
  2. Restore Dependencies

    dotnet restore
    
  3. Build the Solution

    dotnet build
    
  4. Docker Integration

    docker-compose up

About

A comprehensive example project illustrating the implementation of horizontal scaling and load balancing for web applications using YARP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published