AWS - Compute Flashcards

1
Q

What is EC2?

A

This is where you create/deploy your own virtual machine. At AWS you have a wide variety of compute instances you can choose from. This ranges from the type of operating system you would choose to the RAM or CPU you would want your compute instance to have.

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

What is ECS?

educative.io/module/page/0g6xMWFY3wRJDgL7O/10370001/5381087890505728/5550726616449024

A

Amazon ECS is a fully managed container orchestration service that makes it easy for you to deploy, manage, and scale docker containerized applications.

You can create Amazon ECS clusters within a new or existing VPC. After a cluster is up and running, you can define task definitions and services that specify which Docker container images to run across your clusters. Container images are stored in and pulled from container registries, which may exist within or outside of your AWS infrastructure.

The following diagram shows the architecture of an Amazon ECS environment using the Fargate launch type:

educative.io/module/page/0g6xMWFY3wRJDgL7O/10370001/5381087890505728/5550726616449024

app.gitbook.com/s/m6b8HbHixDKxN2Wzugmk/ecs-architecture

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

What is LightSail? (TODO… more details)

A

Amazon Lightsail is a virtual private server (VPS) provider and is the easiest way to get started with AWS for developers, small businesses, students, and other users who need a solution to build and host their applications on cloud

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

What is Lambda?

A

Lambda is a computing service where you can upload your code and create a Lambda function. AWS Lambda takes care of provisioning and managing the servers that you use to run the code. You do not have to worry about operating systems, patching, scaling etc.

It is essentially described as an event-driven computing service where AWS Lambda runs your code in response to events. These events could be changes to the data in an Amazon S3 bucket or an Amazon Dynamo DB table.

Lambda events can trigger other Lambda events or call other AWS services like SQS or SNS.

The evolution or timeline of Lambda looks something like this:
On-Prem DataCenter –> IAAS –> PaaS –> containerization/Docker –> Serverless

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

What are the pros of EC2?

A

[1] AWS EC2 reduces the time required to obtain and boot new server instances to minutes allowing you to quickly scale capacity, both up and down, as your computing requirements change.
In the old world if you need an app server or DB server, you would first need to talk to your developer, decide the size and number of cores you need, and then talk to your procurement team, and by the time the server is in your data center it could take 2+ months.

Now with EC2, you have this with a click of a button. This also means from a startup perspective you do not have the upfront cost of buying all the hardware you need.

[2] EC2 changes the economics of computing by allowing you to pay only for the capacity that you actually use. You also have several tools at the disposal of the developers to build the applications to be resilient and isolate them from failure scenarios.

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

What are the EC2 purchase options?

A

[1] On-demand – Fixed rate by the hour or by the second with no commitment.

[2] Reserved Instance - You reserve an EC2 instance for your use and this gives you a discount.

[3] Spot – Enables you to bid whatever price you want to pay for an instance capacity. This is used if your application has flexible start and stop times. For example, Big Data computation as it is not time-sensitive.

[4] Dedicated Hosts - Can be purchased on-demand, used for regulatory requirements that may not support multi-tenant virtualization.

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

How EC2 instances are divided when it comes to their specialty?

A

[1] Memory Optimized - for Memory Intensive application

[2] General Purpose - for Application Servers

[3] Compute Optimized - CPU intensive Apps/DBs

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

What is Elastic Load Balancer?

A

This is a virtual appliance that is used to distribute traffic across multiple application instances.

Instances are checked by the Load Balancers (LB) and they re-route the traffic if they find an application is not returning any data back.

All AWS Load Balancers have their own DNS name.

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

What is Cloud Watch used for?

A

Cloud Watch is used for:
[1] Monitoring and setting up alarms that notify the user if an AWS threshold is hit.

[2] Events in cloud watch help you to respond to a state change of your resources.

Cloud watch Logs – helps you aggregate monitor and store logs. This is done by installing an agent on your EC2 server.

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

What is CloudTrail?

A

Audits what is created or modified in terms of AWS infrastructure.

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

What is EC2 Placement group?

A

Logical grouping of instances within a single availability zone. You can have placement groups that enable applications to participate in low latency, 10 Gbps networks.

Placement groups are recommended for applications that benefit from low latency and high network throughput or both.

Take for example a Hadoop cluster or a NoSQL database where you need really high network throughput or low latency between your NoSQL DB nodes.

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

Why use Lambda?

https://www.educative.io/module/page/0g6xMWFY3wRJDgL7O/10370001/5381087890505728/6291438012203008

A

[1] The Lambda runtime is fully managed by AWS. Once a function is uploaded and configured, Lambda is responsible for managing the resources required to run the code.

[2] Developers are free from the traditional overhead of configuring and maintaining server instances.

[3] Lambda will immediately scale to meet spikes in demand.

[4] Lambda is cost-effective as you only pay for the computational resources used. This is, of course, true for other AWS compute services, but the cost model for Lambda is more granular than EC2 for example, with resources being charged per 100 milliseconds.

[5] Lambda’s event-driven model means you can integrate nicely with a range of AWS services, but still ensure loose coupling.

[6] It’s very low cost. The first 1 million requests are free and you have to pay 0.20 per 1 million requests thereafter!!

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

Give some real use case of lambda usage.

https://app.gitbook.com/s/m6b8HbHixDKxN2Wzugmk/

https://app.gitbook.com/s/m6b8HbHixDKxN2Wzugmk/

A

Let’s describe the various components in the above Architecture:

[1] Angular Client allows the user to add and delete images from S3. It also calls an API Gateway endpoint to retrieve details for all images uploaded.

[2] Save/Delete Lambda Function will handle image upload and delete events from S3. It will be invoked by S3 when a new image is uploaded - the function will use the supplied event data to call back to S3 and retrieve the image. The image details will be saved to DynamoDB. As an image is deleted the function will use the supplied event data to identify the deleted image and remove the associated details from DynamoDB.

[3] Retrieve Image Details: Lambda Function will retrieve image details from DynamoDB and return JSON results.

[4] Dynamo DB: a single Dynamo DB table will be used to persist image details. All interactions with DynamoDB will happen via the Lambda functions.

[5] API Gateway: an API Gateway endpoint will be used as a bridge to the Retrieve Image Details and Lambda function from the web app.

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

should Application load balancer be created for every ECS service or it can be shared among different services ?

A

It is generally not recommended to share an Application Load Balancer (ALB) among multiple Amazon Elastic Container Service (ECS) services. While it is technically possible to do this, it can lead to a number of challenges and limitations, including difficulty in configuring routing rules, increased complexity in managing the ALB, and reduced scalability and performance. Instead, it is generally best practice to create a separate ALB for each ECS service, which allows for greater flexibility and control in routing traffic to the individual services. This approach also enables each service to scale independently and to take advantage of ALB features such as service discovery, target groups, and automatic scaling.

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