High Availability (HA)

  • AWS provides 3 types of load balancers:
    • Application load balancer (ALB): useful for balancing HTTP/HTTPS traffic, operate at Layer 7 and are application-aware;
    • network load balancer: useful for balancing TCP traffic, operate at Layer 4 and can achieve extreme performance;
    • Classic load balancer: legacy ELBs, can operate at Layer 7 (can include features such as X-Forwarded and sticky sessions, but not application-aware) and Layer 4.
  • ELBs in VPC support IPv4 addresses only, while ELBs in EC2-classic support both IPv4 and IPv6.
  • ELB returns 504 Gateway Timeout when either app server or db server is down.
  • X-Forwarded-For can be used to identify the actual source IP address of the requests.
  • ELBs use health check to determine whether traffic should be forwarded to a certain server.
  • ELBs always have a DNS name (i.e., domain name), but do not have an IP address.
  • Sticky session allows to bind a user's session to a specific EC2 instance.
    • If you enable sticky session for ALBs, the traffic will only be sent at the target group level.
  • It is possible to enable cross-zone load balancing on ELBs.
    • If you do not enable cross-zone LB, you can ask Route53 to split the traffic to different AZs and have one ELB per AZ as well.
  • It is also possible to create a listen with rules to forward traffic based on the path pattern of URLs, which is also known as path-based routing.
    • This is useful for building your own API gateway for microservices.

HA Architecture Principles

  • Everything fails, thus, you should plan for failure.
  • There must be redundant resources for every level.
    • Different regions, different AZs, different subsets, different instances (EC2, RDS).
  • To prepare for scalability, we can do either horizontal scalability (scale out) or veritical scalability (scale up).
  • We have to always seek balance between HA and cost effectiveness.

CloudFormation

  • CloudFormation is a way of completely scripting a set of cloud resources.
    • Other infrastructure-as-code (IaC) solutions like Terraform may be better.
  • CloudFormation also provides some pre-configured templates called Quickstarts.

Elastic Beanstalk

  • Elastic Beanstalk helps to quickly deploy applications on AWS without being aware of the underlying resources used.
  • Elastic Beanstalk is a good starting point, but definitely not a good engineering practice at scale.

results matching ""

    No results matching ""