Elasticity and Scalability are two fundamental cloud architecture principles that guide AWS Architecture.

Elasticity:

  • Allows you to match the supply of resources—which cost money—to demand.
  • Matching needs to utilization is critical for cost optimization.
  • Demand includes
    • external usage – number of customers visiting the website
    • internal usage – application team using development and test environments.
  • Two types
    • Time-based elasticity – turning off resources when they are not being used
    • Volume-based elasticity  – matching scale to the intensity of demand,
Automating Time-Based Elasticity By:
  • The AWS Instance Scheduler can create automatic start and stop schedules for EC2 instance, using AWS CloudFormation template
  • Terminate instances programmatically using Amazon EC2 APIs
  • AWS Lambda functions can also shut down instances when, not being used.
  • AWS Data Pipeline, web service to process and move data between AWS services
  • Amazon CloudWatch, a monitoring service for AWS resources. It collects and tracks metrics and log files, set alarms, and automatically react to changes in AWS resources
Automating Volume-Based Elasticity By:
  • Amazon ECS:
    • It can adjust its desired count up or down in response to CloudWatch alarms.
  • Amazon EC2 Spot Fleets:
    • A Spot Fleet can either launch instances (scale out) or terminate instances (scale in), within the chosen range, in response to one or more scaling policies.
  • Amazon EMR clusters:
    • Programmatically scale out and scale in core and task nodes in a cluster based on specified rules as per scaling policy.
  • Amazon DynamoDB:
    • Dynamically adjust provisioned throughput capacity in response to actual traffic patterns.

Scalability:

  • This is the ability to quickly and easily increase or decrease the resources
  • It affects resources for
    • compute
    • storage
  • Auto Scaling is enabled by Amazon CloudWatch at no extra cost.
  • Components
    • Groups – logical groups containing a collection of EC2 instances with similar characteristics for scaling and management purpose.
    • Launch Configuration – template used by auto-scaling group to launch EC2 instances. can specify
      • the AMI
      • instances type
      • key pair
      • security groups
    • Scaling Plans – tells Auto Scaling when and how to scale.
  • Scaling Types
    • Manual scaling – specify only the changes in maximum, minimum, or desired capacity of auto scaling groups.
    • Auto-scaling maintains the instances with updated capacity.
  • Scaling based on
    • Schedule or time based
    • demand
  • Types of Scaling polices:-
    • Target tracking scaling:– Based on the target value for a specific metric.
    • Step scaling:- Based on a set of scaling adjustments that vary based on size of alarm breach.
    • Simple scaling:- Based on a single scaling adjustment.
Elasticity and scalability
To successfully leverage AWS cloud :
  • Autoscaling allows you to automatically horizontally scale to accommodate load.
  • Bootstrapping allows you automatically setup servers after they boot. (Using components such as Amazon Machine Images (AMI’s) and CloudFormation to automate)
  • Loosely Coupled
  • Stateless
  • Horizontal
  • Treat servers as disposable resources
  • Automate Automate Automate
  • Auto Scaling Lifecycle
Elasticity and scalability

AWS Resources for automation

  • AWS Elastic Beanstalk:
    • It is fastest and simplest way to get an application up and running on AWS. Upload their application code and service automatically handles all details, such as resource provisioning, load balancing, auto scaling, and monitoring.
  • Amazon EC2 Auto recovery:
    • You can create an Amazon CloudWatch alarm that monitors an Amazon EC2 instance and automatically recovers it if it becomes impaired. During instance recovery, instance is migrated through an instance reboot, and any data that is in-memory is lost.
  • Auto Scaling:
    • Maintain application availability and scale Amazon EC2 capacity up or down automatically according to conditions you define.
  • Amazon CloudWatch Alarms:
    • A CloudWatch alarm sends an Amazon Simple Notification Service (Amazon SNS) message when a particular metric goes beyond a specified threshold for a specified number of periods.
  • Amazon CloudWatch Events:
    • CloudWatch service delivers a near real-time stream of system events that describe changes in AWS resources. Rules can be set up in a couple of minutes to route each type of event to one or more targets: AWS Lambda functions, Kinesis streams, SNS, etc.
  • AWS OpsWorks Lifecycle events:
    • It supports continuous configuration through lifecycle events that automatically update instances’ configuration to adapt to environment changes. These events can be used to trigger Chef recipes on each instance to perform specific configuration tasks.
  • AWS Lambda Scheduled events:
    • These events allow you to create a Lambda function and direct AWS Lambda to execute it on a regular schedule.
Menu