Classic Solutions Architectures + Elastic Beanstalk Flashcards

1
Q

What is a better option to using Elastic IPs in my EC2 instance infrastructure, if I don’t want interruptions to my website access?

A

ELB. Put the instances behind an ELB and use health checks.

Using Route 53 directly with your instances and elastic ips is a bad idea since you cant scale horizontally. If you remove an instance it will be in the TTL of the record and users wont be able to access it until the TTL is refreshed.

You can’t use a Route 53 Alias directly against the EC2 instances since aliases can only point to specific AWS resources, like ELBs.

With ELB you can scale horizontally without downtime since the elb wont redirect queries to the instances that are unhealthy.

And you can use an alias to give a dns name to the ELB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Can I use an A record against an ELB?

A

No. ELBs IP address changes all the time. It could be a CNAME record but only if you dont use the apex of your domain.

Best option is an Alias pointing to the ELB resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you optimize your instance horizontal scaling in an ELB?

A

With an auto scaling group. ASG.

You set a min and a max, and when there is little demand, useless instances of your app will be deleted, saving you costs. And when you have more demand more instances will be created, meeting the demand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you make your ELB application infrastructure highly available?

A

make your ELB multi az and spread your instancess across mulyiple target groups in different AZs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you save money if you know you will have at least 6 instances running in your infrastructure?

A

With reserved instances. You commit to 1 or 3 years bu you save a lot of money.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If you have an ELB with auto scaling. How can you save money on instances for when you have high demand of horiontal scaling?

A

Use reserved instances for your base fleet, and use spot instances or spot fleet for when the demand increases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a stateless app and a stateful app?

A

A stateless app doesn’t store user data. A stateful app does. Stateful apps use a database. Stateless apps don’t need one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If you have a clothes shopping app behind an ELB, and users are losing their data for example a shopping cart. How do you avoid this?

A

An option is by enabling stickiness, which is an ELB feature.

Another option is using cookies. User stores the cart data with cookies in his browser. Cookies are limited to 4kb

A third option is using ElastiCache. User will have a server session, with a session id, and the cart data will be stored in elasticache. All instances in the ELB can retrieve the cart info from the same elasticache using the session id of the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you store user data long term for your web app?

A

With an RDS database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you deal with increasing read demand on your RDS database?

A

One option is creating read replicas for dealing with the reads and alleviating load from the master db.

Another option is implementing an elasticache, and setting it up so it will keep the most requested data in its cache and respond to these requests instead of the RDS database, alleviating load from it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a 3-tier architecture application?

A

An app architecture implementation consisting of a presentation tier (Client), Logic tier (Server), and data tier (Database).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

if you want users to be able to store images in a website, for example wordpress, and this website is behind an ELB. What is the best option for storing the pictures?

A

EFS: Elastic file system is a share that can be accessed by all the instances of your ELB app at the sam time, since it’s an NFS.
EFS creates ENIs in all the AZs of your instances so it’s Multi AZ.
It’s shared storage so all instances in the ELB can read the images stored.

S3 is also a possibility. But EFS is lower latency from your EC2 instances. Depends on if its just storing stuff or that stuff needs to be accessed/read fast and frequently, in which case EFS is better for this case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you instantiate your apps more quickly?

A

For EC2:
Prepare an AMI with everything you need for your app beforehand. This is called your “Golden AMI”.
Use the user data only for dynamic configurations on 1st launch.
Use Elastic Beanstalk, which is a mix of the previous 2.

For RDS:
Have a snapshot ready to restore from. The DB will have schemas and data ready for use.

For EBS Volumes:
Restore from Snapshot. Disk already formatted and with necessary data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Elastic Beanstalk?

A

It’s a service that will automate the deployment and scaling of app infrastructures that use EC2, ELB, RDS, ElastiCache, ASG, etc.

The only responsibility for you when using beanstalk is to develop the app code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

With beanstalk, do you lose control of the components of the infrastructure?

A

No. You still have full control but the services come bundled with beanstalk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the cost of using beanstalk?

A

It’s free. You pay for the underlying resources.

17
Q

What are beanstalk components?

A

An application: The collection of all the components.
Application Version: an iteration of your app code.
Environment: The collection of the resources used to run your application version (only on app version is running at a time).
Tiers: You have the web server environment tier and the worker environment tier.
Multiple environments: Dev, test, prod etc.

18
Q

What is the process of using Beanstalk?

A

First you create an application

Then you upload a version of that app to beanstalk.

Then you launch an environment fit for your app.

Then you manage your environment and its lifecycle.

PD: You can then update the app version and deploy it.

19
Q

What is beanstalk compatible with in the developer side?

A

Many languages like Go, Java SE, Python, .NET, Node JS, PHP. Etc.

20
Q

What is Web server tier vs Worker tier?

A

A web server tier is an environment that is made for web server, consisting of an ELB EC2 instances, and ASG, etc.

And a worker tier is an environment consisting of an SQS Queue, ASG, and EC2 instances (workers).

21
Q

What is a good Beanstalk deployment mode for development?

A

A single instance with an elastic ip, and an RDS master instance.

22
Q

What is a good Beanstalk deployment for prod?

A

HA environment, with load balancer, ASG, and multi AZ RDS DB.

23
Q

What do you need an IAM role for in Elastic Beanstalk?

A

You need to assign an IAM Role in creation of your environment so that elastic beanstalk can perform the tasks needed to deploy that environment.

24
Q
A