skip to Main Content

We are looking to separate our blog platform to a separate ec2 server (In Nginx) for better performance and scalability.

Scenario is:

  1. Web request (www.example.com) -> Load Balancer/Route -> Current EC2 Server
  2. Blog request (www.example.com/blog) -> Load Balancer/Route -> New Separate EC2 Server for blog

Please help in this case what is the best option to use:

  1. Haproxy
  2. ALB – AWS
  3. Any other solution?

Also, is it possible to have the load balancer or routing mechanism in a different AWS region? We are currently hosted in AWS.

3

Answers


    • Haproxy

    You would have to set this up on an EC2 server and manage everything yourself. You would be responsible for scaling this correctly to handle all the traffic it gets. You would be responsible for deploying it to multiple availability zones to provide high availability. You would be responsible for installing all security updates on the operating system.

    • ALB – AWS

    Amazon will automatically scale this out to handle any amount of traffic you get. Amazon will handle all security patches of the underlying system. Amazon provides free SSL certificates for ALBs. Amazon will deploy this automatically across multiple availability zones to provide high availability.

    • Any other solution?

    I think AWS Global Accelerator would work here as well, but you would have to weigh the differences between Global Accelerator and ALB to decide which fits your use case and budget the best.

    You could also look at placing a CDN in front of everything, like CloudFront or Cloudflare.


    Also, is it possible to have the load balancer or routing mechanism in
    a different AWS region?

    AWS Global Accelerator would be the thing to look at if load balancing in different regions is a concern for you. Given the details you have provided I’m not sure why you would want this however.

    Probably what you really need is a CDN in front of your websites, with or without the ALB.

    Login or Signup to reply.
  1. Scenario is:

    Web request (http://www.example.com) -> Load Balancer/Route -> Current EC2
    Server Blog request (http://www.example.com/blog) -> Load Balancer/Route ->
    New Separate EC2 Server for blog

    In my view you can use ALB deployed in multi AZ for high availability for the following reasons :-

    i have answered on [something similar] it might help you also

    Login or Signup to reply.
  2. This is my opinion, take it as that. I am sure a lot of people wont agree.

    If your project is small or personal, you can go with HAProxy (Cheap USD4 or less if you get a t3a as a spot instance) Or free if you place it inside another EC2 of yours may be using docker.

    If your project is not personal or not small, go with ALB (Expensive but simpler and better integrated to other AWS stuff)

    HAProxy can handle tons of connections, but you have to do more things by yourself. ALB can also handle tons of connections and AWS will do most of the work.

    I think HAProxy is more suitable for personal/small projects because if your project doesnt grow, then you dont have to touch HAProxy. It is set and forget the same as ALB but cost less.
    You usually wont mind about Availability zones or disaster tolerance in a personal project, so HAProxy should be easy to config.

    Another consideration: AWS offers a free tier on ALB, so if your project will run for less than a year ALB is the way to go.

    If you are learning, then ALB should be considered because real clients usually love to stick to AWS in all aspects, and HAProxy is your call and also your risk (just to reduce cost for a company that usually pays a lot more for your salary, so not worth the risk).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search