Company
Date Published
Author
Anthony Stanton
Word count
802
Language
English
Hacker News points
None

Summary

At Contentful, we utilize Amazon Web Services' Elastic Load Balancer and open-source HAProxy software to manage traffic routing and load-balancing of our API services. Our infrastructure is configured using Chef, allowing us to scale down without affecting user requests. To address the challenge of scaling down without losing customer connections, we implemented an Auto Scaling lifecycle hook that removes instances from HAProxy before they are terminated. However, this process required a central location to receive notifications and add tags to instances. This is where AWS Lambda comes in, providing a zero-administration compute platform for executing stateless code in response to events. We implemented a 20-line Node JS function using Lambda to handle the tagging process, eliminating complexity and ensuring correct operation.