Search code examples
amazon-web-servicesarchitectureclouddistributed-systemamazon-elb

Should I use a single AWS Load Balancer in a distributed environment?


I have a distributed environment with systems and microservices, they integrate using Apis Rest. I have the objective of reaching high availability and a strategy that I am trying to achieve is to have instances with a Load Balancer in front of them. Do I need to have an AWS Load Balancer for each set of instances of a system or is it enough to have just one to serve them all? For example, I have 2 instances of application A and 2 instances of application B. I can have an AWS Load Balancer for 4 instances or I would need to have a load balancer for application A and another for application B. If both possible alternatives, what are the advantages and disadvantages of each?


Solution

  • You can have only one Elastic Load Balancer for your requirements.

    Your final architecture will be something like this:

    Architecture for two Applications

    Advantages:

    • You will have less costs (Because each alb hour have a cost)
    • You can scale your applications separated without problems with the target groups and scale politic definitions
    • It's more elegant

    Disadvantages:

    • You have a path for each application (but I don't think that it's a problem for you)