aws_cloud_practitioner

Compute at AWS Cloud

Amazon EC2

Amazon Elastic Compute Cloud (Amazon EC2) provides secure, resizable compute capacity in the cloud as Amazon EC2 instances.

When you spin up an EC2 instance, you aren’t necessarily taking an entire host to yourself. Instead, you are sharing the host with multiple other instances, otherwise known as virtual machines. And a hypervisor running on the host machine is responsible for sharing the underlying physical resources between the virtual machines. This idea of sharing underlying hardware is called multitenancy.

EC2 instances are resizable. You might start with a small instance, but at some point you can give that instance more memory and more CPU. This is what we call vertically scaling an instance.


How Amazon EC2 works

  1. Launch an instance - select a template with basic configuration, instance type, security and network settings.
  2. Connect to the instance (e.g. ssh)
  3. Use instance - install software, add storage…

Some benefits of using Amazon EC2 include:


Amazon EC2 instance types

  1. General purpose instances provide a balance of compute, memory, and networking resources.

If you have an application in which the resource needs for compute, memory, and networking are roughly equivalent, you might consider running it on a general purpose instance because the application does not require optimization in any single resource area.

  1. Compute optimized instances are ideal for compute-bound applications that benefit from high-performance processors.

Ideal for compute-intensive tasks like gaming servers, high performance computing or HPC, and even scientific modeling.

  1. Memory optimized instances are designed to deliver fast performance for workloads that process large datasets in memory.

  2. Accelerated computing instances use hardware accelerators, or coprocessors, to perform some functions more efficiently than is possible in software running on CPUs.

Examples of these functions include floating-point number calculations, graphics processing, and data pattern matching. Accelerated computing instances are ideal for workloads such as graphics applications, game streaming, and application streaming.

  1. Storage optimized instances are designed for workloads that require high, sequential read and write access to large datasets on local storage.

Amazon EC2 Pricing

  1. On-Demand Instances are ideal for short-term, irregular workloads that cannot be interrupted.

Use cases: developing and testing applications and running applications that have unpredictable usage patterns. Not recommended for workloads that last a year or longer.

  1. Amazon EC2 Savings Plans enable you to reduce your compute costs by committing to a consistent amount of compute usage for a 1-year or 3-year term.

This term commitment results in savings of up to 72% over On-Demand costs.

  1. Reserved Instances are a billing discount applied to the use of On-Demand Instances in your account.

You can purchase Standard Reserved and Convertible Reserved Instances for a 1-year or 3-year term, and Scheduled Reserved Instances for a 1-year term.

  1. Spot Instances are ideal for workloads with flexible start and end times, or that can withstand interruptions.

Spot Instances use unused Amazon EC2 computing capacity and offer you cost savings at up to 90% off of On-Demand prices.

  1. Dedicated Hosts are physical servers with Amazon EC2 instance capacity that is fully dedicated to your use.

You can use your existing per-socket, per-core, or per-VM software licenses to help maintain license compliance.

You can purchase On-Demand Dedicated Hosts and Dedicated Hosts Reservations.


Amazon EC2 Scaling

Scalability

Scalability involves beginning with only the resources you need and designing your architecture to automatically respond to changing demand by scaling out or in.

If you want the scaling process to happen automatically, the AWS service that provides this functionality for Amazon EC2 instances is Amazon EC2 Auto Scaling.


Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling enables you to automatically add or remove Amazon EC2 instances in response to changing application demand. It also ensures high availability.

Scaling out (horizontal scaling) is when you add more instances to your Auto Scaling Group and scaling in is when you reduce the number of instances in your Auto Scaling Group.

Within Amazon EC2 Auto Scaling, you can use two approaches: dynamic scaling and predictive scaling.

Amazon EC2 Auto Scaling Example

When you create an Auto Scaling group, you can set the minimum number of Amazon EC2 instances.

example


Elastic Load Balancing

A load balancer is an application that takes in requests and routes them to the instances to be processed.

Elastic Load Balancing is the AWS service that automatically distributes incoming application traffic across multiple resources.

Elastic Load Balancing runs at the Region level rather than on individual EC2 instances.

example

example


Monolithic Apps vs Microservices

If you have an app with tightly coupled components, this type of architecture can be considered a monolithic application.

In this approach to application architecture, if a single component fails, other components fail, and possibly the entire application fails.

example

In a microservices approach, application components are loosely coupled.

In this case, if a single component fails, the other components continue to work because they are communicating with each other.

example

Two services facilitate application integration:


Amazon SNS

Amazon Simple Notification Service (Amazon SNS) is a publish/subscribe service.

Using Amazon SNS topics, a publisher publishes messages to subscribers.Subscribers can be web servers, email addresses, AWS Lambda functions…

It is possible for subscribers to subscribe to a single topic or to multiple topics.


Amazon SQS

Amazon Simple Queue Service (Amazon SQS) is a message queuing service.

Using Amazon SQS, you can send, store, and receive messages between software components, without losing messages or requiring other services to be available.

In Amazon SQS, an application sends messages into a queue. A user or service retrieves a message from the queue, processes it, and then deletes it from the queue.


Additional Compute Services

Serverless Computing

The term “serverless” means that your code runs on servers, but you do not need to provision or manage these servers.

example

Serverless means that you cannot actually see or access the underlying infrastructure or instances that are hosting your application.

Another benefit of serverless computing is the flexibility to scale serverless applications automatically.


AWS Lambda

AWS Lambda is a service that lets you run code without needing to provision or manage servers.

example

AWS Lambda is a service that allows you to upload your code into what’s called a Lambda function. Configure a trigger and from there, the service waits for the trigger. When the trigger is detected, the code is automatically run in a managed environment.


Containers

Containers provide you with a standard way to package your application’s code and dependencies into a single object.

Container orchestration services help you to deploy, manage, and scale your containerized applications.


Amazon ECS

Amazon Elastic Container Service (Amazon ECS) is a highly scalable, high-performance container management system that enables you to run and scale containerized applications on AWS.

Amazon ECS supports Docker containers.

AWS supports the use of open-source Docker Community Edition and subscription-based Docker Enterprise Edition.


Amazon EKS

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed service that you can use to run Kubernetes on AWS.

Kubernetes is open-source software that enables you to deploy and manage containerized applications at scale.


AWS Fargate

AWS Fargate is a serverless compute engine for containers. It works with both Amazon ECS and Amazon EKS.

When using AWS Fargate, you do not need to provision or manage servers.


Compute Options


Notes


References