Skip to main content

01. Scalability & High Availability & Elasticity


🧩 A. Scalability

Scalability is the ability of a system to handle increased load by adjusting resources.


🔸 Two Types of Scalability

TypeDescriptionExample
Vertical ScalabilityIncrease the capacity of an existing instance (scale up/down)Upgrading from t2.microt2.large
Horizontal ScalabilityIncrease the number of running instances (scale out/in)Multiple EC2 instances behind a Load Balancer

🏗️ A1. Vertical Scalability

  • Also called scale up (or scale down when reducing resources).
  • Involves increasing CPU, memory, or I/O of a single instance.
  • Best suited for non-distributed systems (for example, traditional databases).

💡 Example

  • AWS example
    • Change instance type from t2.micro → t2.large.

⚠️ Limitation

  • Limited by physical hardware constraints.
  • There is always a maximum size an instance can scale to.

🌐 A2. Horizontal Scalability

  • Also called scale out (add instances) and scale in (remove instances).
  • Adds more machines instead of upgrading one.
  • Requires a distributed application architecture.

💡 Example

  • AWS example
    • Multiple EC2 instances behind an Elastic Load Balancer (ELB).
    • Managed automatically using an Auto Scaling Group (ASG).

🧭 B. High Availability

  • Ensures applications remain available even if one AZ fails.
  • Achieved by deploying resources across multiple Availability Zones.
  • Eliminates single points of failure and improves fault tolerance.

💡 Example

  • Two call centers:
    • New York and San Francisco
  • If New York experiences a power outage, San Francisco continues handling traffic.
  • The application remains available.

⚙️ High Availability in AWS

AWS typically achieves High Availability using:

  • Auto Scaling Group (Multi-AZ)
    Automatically launches instances across multiple AZs.
  • Elastic Load Balancer (Multi-AZ)
    Distributes traffic only to healthy instances across AZs.

How they work together:

  • ELB redirects traffic away from unhealthy instances or AZs.
  • ASG replaces failed instances automatically in other AZs.

🧮 C. Elasticity

  • Elasticity extends scalability by automatically adjusting capacity based on demand.
  • No manual intervention is required.
  • Optimizes performance and cost efficiency.

💡 Example

  • Traffic spikes at 8 PM, drops after midnight:
    • ASG scales out during peak hours.
    • ASG scales in during low traffic.
  • You pay only for consumed resources.

⚙️ Elasticity in AWS

Elasticity is implemented using:

  • Auto Scaling Groups (ASG)
    Scale EC2 instances based on metrics like CPU or request count.
  • Elastic Load Balancer (ELB)
    Automatically routes traffic as instances are added or removed.

🧠 Scalability vs Elasticity

ConceptDescriptionAutomationExample
ScalabilityAbility to handle increased loadManual or automaticAdd more EC2 instances
ElasticityAutomatic scaling based on demandFully automaticASG adds/removes EC2 instances dynamically

✅ Summary

  • High Availability keeps applications running during failures.
  • Elasticity ensures efficiency by adjusting capacity automatically.
  • Together, they enable resilient, cost-optimized, cloud-native systems.

📊 EC2 Scalability Summary

TypeActionExampleAWS Service Used
Vertical ScalingScale Up / Downt2.micro → t2.largeChange EC2 Instance Type
Horizontal ScalingScale Out / In1 → many EC2 instancesASG + ELB
High AvailabilityMulti-AZ DeploymentMultiple AZsMulti-AZ ASG + ELB

🧠 Cloud Concepts Comparison

ConceptDefinitionKey Idea
ScalabilitySystem handles more loadGrow capacity
ElasticitySystem auto-scales with demandPay-per-use efficiency
AgilityRapid deployment of IT resourcesFaster innovation