Day 49 โ€“ Auto Scaling Groups in AWS with the vprofile Stack

Today I worked on Auto Scaling Groups (ASG) in AWS by implementing them for the vProfile project โ€” a real-world Java web app architecture that simulates a production stack.


๐Ÿ”ง Tech Stack Overview (vProfile Project)

Hereโ€™s the complete application infrastructure I worked with:

ComponentRole
MySQLRelational database
MemcachedIn-memory cache
RabbitMQMessage broker
TomcatJava-based app server
NginxReverse proxy/web server

๐ŸŒฉ๏ธ What is an Auto Scaling Group?

An Auto Scaling Group in AWS:

  • Ensures EC2 instances maintain desired capacity

  • Automatically scales out/in based on CloudWatch metrics (CPU, network, etc.)

  • Works in tandem with Launch Templates or Launch Configurations

  • Integrates with Load Balancers (like ALB/NLB)


๐Ÿ—๏ธ Steps I Followed for Auto Scaling the vProfile App:

  1. Created a Launch Template

    • Configured EC2 with user data to install dependencies like Tomcat, Java, app war file, etc.
  2. Configured an Application Load Balancer

    • Listener: Port 80 โ†’ Target Group (EC2 instances running vProfile)
  3. Defined Auto Scaling Group

    • Minimum instances: 2

    • Desired capacity: 2

    • Maximum: 5

    • Scaling policy: Target CPU > 70%

  4. Connected ASG to ALB

    • Ensures traffic routing to healthy instances only
  5. Tested Scaling

    • Simulated high CPU to trigger scale out

    • Saw new EC2 instances come up automatically ๐ŸŽ‰


๐Ÿ’ก Why Auto Scaling Matters

  • Cost-efficient: Scale-in during low traffic hours

  • Highly Available: Replaces unhealthy EC2 instances

  • Elastic: Adapts dynamically to load


๐Ÿง  Key Learning:

Configuring Auto Scaling taught me how critical automation and elasticity are for cloud-native apps. When tied with monitoring (CloudWatch) and ALBs, ASGs become a powerful force to ensure uptime and scalability.


๐Ÿ“Œ Up Next:

Iโ€™ll be exploring s3 and how to host a wordpress site on s3.

0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir