AWS Elastic Beanstalk Flashcards
What is Elastic Beanstalk?
Simplifies deploying, managing, and scaling web applications.
What are the Elastic Beanstalk components?
Application, Application version, & Environment.
What is the Application component?
Collection of Elastic Beanstalk components (environments, versions, configurations, …)
What is the Application Version?
An iteration of your application code
What is the Environment component?
Collection of AWS resources running an application version (only one application
version at a time)
What are the two tiers for the Environment component?
Web Server Environment Tier & Worker Environment Tier
Features:
- Utilizes a load balancer to direct traffic.
- Employs an auto-scaling group with multiple EC2 instances functioning as web servers.
- This setup is referred to as “architecture number one with Beanstalk.”
- Scale based on the number of SQS messages
- Can push messages to SQS queue from anotherWeb ServerTier
Traditional Web Tier Architecture
What is the Integration of Web and Worker Environments?
The web environment can push messages into the SQS queue used by the worker environment, linking both systems effectively.
Features:
- Does not have direct client access to EC2 instances.
- Utilizes an SQS (Simple Queue Service) queue to hold incoming messages.
- EC2 instances act as workers, pulling and processing messages from the SQS queue.
- Scales based on the number of messages in the SQS queue; more messages trigger more EC2 instances.
- Referred to as “architecture number two with Beanstalk.”
Beanstalk Worker Environment
What are the two deployment modes?
- Single Instance Deployment
- High Availability Deployment
Features:
- Suitable for development purposes.
- Consists of a single EC2 instance with an Elastic IP.
- May include additional resources like an RDS database.
- Offers a straightforward setup for simpler, non-scalable applications.
Single Instance Deployment
Features:
- Ideal for production environments.
- Utilizes a load balancer to distribute traffic across multiple EC2 instances.
- Includes an auto-scaling group to manage the scaling of instances across multiple Availability Zones.
- Often features an RDS database configured for multi-AZ deployments to ensure high availability and failover support.
High Availability Deployment
What are Beanstalk Deployment Options?
- All at once
- Rolling
- Rolling with additional batches
- Immutable
- Blue Green
- Traffic Splitting
What is All at once deployment?
(deploy all in one go) – fastest, but instances aren’t available to serve traffic for a bit (downtime)
What is “Rolling” deployment?
Update a few instances at a time (bucket), and then move onto the next bucket once the first bucket is healthy
What is “Rolling with additional batches” deployment?
Like rolling, but spins up new instances to move the batch (so that the old application is still available)
What is “Immutable” deployment?
Spins up new instances in a new ASG, deploys version to these instances, and then swaps all the instances when everything is healthy
What is “Blue Green” deployment?
Create a new environment and switch over when ready
What is “Traffic Splitting” deployment?
Canary testing – send a small % of traffic to new deployment
Features:
- Fastest deployment
- Application has downtime
- Great for quick iterations in development environment
- No additional cost
All at once
Features:
- Application is running at capacity
- Can set the bucket size
- Application is running both versions simultaneously
- Small additional cost
- Additional batch is removed at the end of the deployment
- Longer deployment
- Good for prod
Rolling with additional batches
Features:
- Application is running below capacity
- Can set the bucket size
- Application is running both versions simultaneously
- No additional cost
- Long deployment
Rolling
Features:
- Zero downtime
- New Code is deployed to new instances on a temporary ASG
- High cost, double capacity
- Longest deployment
- Quick rollback in case of failures (just terminate new ASG)
- Great for prod
Immutable
Features:
- Not a “direct feature” of Elastic Beanstalk
- Zero downtime and release facility
- Create a new “stage” environment and deploy v2 there
- The new environment (green) can be validated independently and roll back if issues
- Route 53 can be setup using weighted policies to redirect a little bit of traffic to the stage environment
- Using Beanstalk, “swap URLs” when done with the environment test
Blue / Green
Features:
- Canary Testing
- New application version is deployed to a temporary ASG with the same capacity
- A small % of traffic is sent to the temporary ASG for a configurable amount of time
- Deployment health is monitored
- If there’s a deployment failure, this triggers an automated rollback (very quick)
- No application downtime
- New instances are migrated from the temporary to the original ASG
- Old application version is then terminated
Traffic Splitting
What does Elastic Beanstalk rely on under the hood?
CouldFormation
What is CloudFormation used for?
To provision AWS services
What is Elastic Beanstalk Cloning?
Clone an environment with the exact same configuration
All….. and …… are preserved when you clone and enviornment.
resources, configurations
What does Elastic Beanstalk do?
Automatically handles infrastructure tasks like provisioning, load balancing, and scaling.