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

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay