vinitparekh17 / my-micro

A basic microservice with 4 server and haproxy load balancer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic-microservice

Tech and Tool introduction

  • Node servers
  • HAPROXY load balancer
  • Docker

1. Node servers

Here I created basic node server with express framework.

2. HAPROXY

HAProxy is a free, open source high availability solution, providing load balancing and proxying for TCP and HTTP-based applications by spreading requests across multiple servers. It is written in C and has a reputation for being fast and efficient. Click here to learn more about HAPROXY.

3. Docker

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. Click here for easy intro about it.

Flow of the system

I created a basic server with express which displays the port number and name dynamically from env variables. After it I used a load balancer to ditrubute the load of multiple servers. I specified config of lb in haproxy dir. to intruct it for my server handling. I wrote a docker-compose file and spacified the container name, port, image name and env variables in it and finally used command docker-compose-up to spin up the containers.

About

A basic microservice with 4 server and haproxy load balancer.


Languages

Language:JavaScript 100.0%