DEV Community

Le Huy Ho
Le Huy Ho

Posted on

Learning AWS - DVA - Day 9: ELB Advanced

ELB - Sticky Sessions

Session Affinity

  • It is possible to implement stickiness so that the same client is always redirected to the same instance behind a load balancer

  • This works for Classic Load Balancer, Application Load Balancer, Network Load Balancer

  • The "cookie" used for stickiness has an expiration date you control

  • Use case: make sure the user doesn't lose his session data

  • Enabling stickiness may bring imbalance to the load over the backend EC2 instances

Cookie Names

  • Application-based Cookies:

    • Custom cookie: generated by the target - don't use AWSALB, AWSALBAPP, AWSALBTG(reserved for use by ELB)
    • Applicaiton cookie: generated by the load balancer - cookie name is AWSALBAPP
  • Duration-base Cookies: generated by the load balancer. Cookie name is AWSALB (for ALB), AWSEL (for CLB)


Cross-Zone Load Balancing

  • Application Load Balancer

    • Enabled by default (can be disabled at the Target Group Level)
    • No charges for inter AZ data
  • Network Load Balancer & Gateway Load Balancer

    • Disabled by default
    • You pay charges ($) for inter AZ data if enabled
  • Classic Load Balancer

    • Disabled by default
    • No charges for inter AZ data if enabled

Image of Datadog

Learn how to monitor AWS container environments at scale

In this eBook, Datadog and AWS share insights into the changing state of containers in the cloud and explore why orchestration technologies are an essential part of managing ever-changing containerized workloads.

Download the eBook

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more