Beanstalk Flashcards
golden AMI
you install your applications, your OS dependencies etc, everything beforehand, and then you create an AMI from it
and then for the future EC2 instances you just launch them directly from the disk golden AMI
the fastest way we can start up our EC2 instance
Bootstrapping instance with user data
means configuring the instance when it first starts. During ootstrapping we could also install application OS dependency’s etc. But this is going to be very slow and we don’t want each application to do the exact same thing the other one did if it can be repeated.
But for dynamic configuration for example maybe retrieving the URL for our data base and the password etc. we can use bootstrapping using the EC2 user data
We can have a hybrid mix with a golden AMI.
for RDS databases we can restore
from the snapshots and then the database will have the schemas and the data ready.
EBS volumes we can restore from
a Snapshot so we don’t have to have a disc that’s empty and not formatted, we can retreat from a snapshot and the snapshot will already be formatted properly and have the data we need.
BeanStalk
is a managed service. That means that the instance configuration, all of the operating system, will be handled by BeanStalk. The deployment strategy, you can configure it, but again it will be performed by BeanStalk. And just the application code is your responsibility.
three architecture models for BeanStalk
- single instance deployment
- a load balancer + an auto-scaling group.
- ASG only
single instance deployment
good for DEV.
So, you’ll have a whole environment, and it’s going to be one instance.
a load balancer + an auto-scaling group deployment
That’s great when you do production or pre-production for your web applications and you want to see how they react at scale.
ASG only deployment
it is great when you do non-web apps in production,
such as your workers or other kind of models that don’t need a load balancer or don’t need to be accessible.
BeanStalk has three components.
- an application
- an application version, so every time you upload new code, you’ll get an application version,
- and environment name, so you’re going to deploy your code to DEV, TEST, and PROD.
And you’re free to name your environments just the way you want, and have as many environments as you wish. You’re going to deploy applications to your environments, and basically will be able to promote
these application versions to the next environments.
Beanstalk the idea
you create an application, and you create an environment or multiple environments, and then, you’re going to upload a version and you’re going to give it an alias, so, just a name that you want.
And then, this alias, you will release it to environments.
You have an ASG that scales on demand based on the traffic going to your new website: TriangleSunglasses.Com. You would like to optimise for cost, so you have selected an ASG that scales based on demand going through your ELB. Still, you want your solution to be highly available so you have selected the minimum instances to 2. How can you further optimize the cost while respecting the requirements?
reserve 2 EC2 instances
Which of the following will help make our application tier stateless?
- send the session data through the client cookies
This is an option to make our application tier stateless in which the clients send their session data, so that our servers don’t need to “remember” the session data
- store the session data in ElastiCache
This will help as the session data can now be accessed from multiple servers - offload data in RDS
This will help as the data can now be accessed from multiple servers
Which of the following will NOT help make our application tier stateless?
storing shared data on EBS volumes
EBS volumes are created for a specific AZ and can only be attached to one EC2 instance at a time. This will not help make our application stateles
You are looking to store shared software updates data across 100s of EC2 instances. The software updates should be dynamically loaded on the EC2 instances and shouldn’t require heavy operations. What do you suggest?
store the software updates on EFS and mount EFS as a network drive
EFS is a network file system (NFS) and allows to mount the same file system to 100s of EC2 instances. Publishing software updates their allow each EC2 instance to access them.