In such a sale, only lucky visitors are able to buy a single pc. This is successfully running for months for Adidas sites in Singapore, Malaysia, Philippines, and Thailand.
The solution costs less 500$ per sale on AWS but is able to do sales worth of a few hundred thousand dollars in just in an hour time.
- Client: Singapore Post
- Date: 2017
- Skills: Cloud Architecture, AWS Expertise, Managed Services
Challenge & Solution
While using Jenkins on Amazon EC2, few of the keys AWS Services being leveraged to develop the solutions are:
- Amazon CloudFront
- AWS CLB/ALB
- Amazon EC2
- Auto Scaling
- Amazon Route 53
- Amazon S3
- Amazon RDS
1) For Performance: All the site traffic is being routed from Amazon CloudFront, and the static content cached at Amazon CloudFront which improved performance.
Setup 3 separate origins: (1) ELB1 (Regular Web Front ELB) - To serve web app dynamic traffic ; (2) ELB2 (Wait Room ELB) - To serve only sale categories. - WR ELB; (3) Amazon S3 - To server all the static content like css, js and all the media
2) The WR ELB which serves sale categories, passing through HA Proxy setup. The HAProxy having the full business logic, it’s configured to split the traffic with M:N weightage, the M pc of traffic goes back to Web App system, and they are the lucky members who can get their shoes.
The remaining N pc of traffic are in Wait Room which served by Nginx. This page gets refreshed in 60 seconds and redirected back to WR ELB.
- 2.1. Every minute HA Proxy allows M pc of requests back to Web App system. It continues as longs as the product quantities are available / backend Web App system in the healthy state.
- 2.2. If any time the HA Proxy system founds backend Web System loaded, the system stops sending new requests back to Web App system. And all the existing users continue to go back to Web App system finish their checkout.
- 2.3. This entire system continuously monitored from Amazon CloudWatch and our custom monitoring system. Based on the alarms, each layer gets Scale In / Out.
3) Once everything sold out, we update HAProxy configuration to redirect everybody to the SoldOut banner.
4) Based on live traffic stats, we update M and N ratio values for Wait Room.
5) Built this entire process as Pipelines using Jenkins. From Jenkins we can update Weights, Amazon CloudFront behaviors, Modifying sale category banners and Scale In/Out configuration.
6) Once after enabling Sold Out banners, the system redirects all the traffic back to the Web App environment and brings down the WaitRoom setup (HA Proxy + Nginx ).