Cloud Computing #Day 2
Tags: aws, cloud, serverless, cloudskills
Published: 2022-07-24 13:05:25

Good Wishes to the second day of my Cloud Computing aka AWS journey, I came across the architechtural insights of virtual servers, which are not only <strong>reliable and secure</strong> but also <strong>scalable and elastic</strong> which is why the name <strong>Amazon Elastic Cloud Compute (Amazon EC2)</strong>

## What is Amazon EC2 ?


![image](https://user-images.githubusercontent.com/88903134/180647421-3eca92c5-cc57-4c20-aaab-8da43c40c8a1.png)




Amazon EC2 eliminates the need to invest in hardware up front hence can be used to launch as many or as few virtual servers as needed; configure security and networking and manage storage.  
Amazon EC2 enables a user to scale up or down to handle changes in requirements or spikes in popularity, reducing the need to forecast traffic. Now this can be a lot of keywords altogether, allow me to introduce the features of Amazon EC2 :

### Features of Amazon EC2 : 

- <strong>Virtual Computing Environments :</strong> a virtual machine or server (cloud based or physical) known as <strong>instances</strong>
- <strong>Amazon Machine Images(AMIs) :</strong> preconfigured templates that contains the software configuration
- <strong>Virtual Private Clouds</strong>
- Secure login information in form of key pairs( public and private)
- And others like, <strong>instance types</strong>, metadata, firewall, <strong>instance store volumes</strong>, Elastic IP addresses etc.


### Here comes the Virtual Computing Environments into discussion, What is an Instance ?

An EC2 instance is a virtual machine (VM) that runs in the AWS Cloud. When you launch an instance, you decide the virtual hardware configuration by choosing an instance type.  

### Keynotes:
- An instance is a VM.
- An instance type is the combination of virtual hardware components, such as CPU and memory, that make up the instance.
- Instance names are a combination of the instance family, generation, and size. We will look into this discussion later.


### Instance Families : 

![image](https://user-images.githubusercontent.com/88903134/180446718-151354d8-ed16-4198-80c1-588c258b3b55.png)

<br>

As we can understand from the image there are five different instance families :

#### <summary> <strong>General Purpose</strong> </summary>  

<details> General-purpose instances provide a balance of compute, memory, and networking resources and can be used for a wide range of workloads.
<strong>Use cases:</strong> 
These instances are ideal for applications that use these resources in equal proportions: such as web servers and code repositories. </details> 
#### <summary> <strong>Compute Optimized</strong> </summary>
<details>Compute-optimized instances are ideal for compute-bound applications that benefit from high-performance processors. Instances belonging to this family are well suited for compute-intensive operations. <br> 
<strong>Use cases:</strong> 
- Batch processing workloads 
- Media transcoding 
- High-performance web servers 
- High performance computing (HPC) 
- Scientific modeling 
- Dedicated gaming servers and ad server engines 
- Machine learning (ML) inference </details>
#### <summary><strong>Memory Optimized</strong> </summary>
<details> Memory-optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.
<br> <strong>Use cases:</strong> 
- High-performance, relational (MySQL) and NoSQL (MongoDB, Cassandra) databases. 
- Distributed web scale cache stores that provide in-memory caching of key-value type data (Memcached and Redis). </details>
#### <summary><strong>Storage Optimized</strong> </summary>
<details>Storage-optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications. </details> 
#### <summary> <strong>Accelerated Computing</strong> </summary>
 <details>If you require high processing capability, you will benefit from using accelerated computing instances, which provide access to hardware-based compute accelerators such as graphics processing units (GPUs), field-programmable gate arrays (FPGAs), or AWS Inferentia. 
<strong>Use cases:</strong>
- Video rendering 
- Analytics (big data) </details> 


### Decoding nomenclature:

![image](https://user-images.githubusercontent.com/88903134/180446090-67444b88-bf8a-4fc6-aeb1-4e3260ccb9ef.png)


Analysing the picture , we can easily decipher the instance naming hence I am refraining for elaboration.


### Amazon EC2 Pricing

Amazon EC2 offers a variety of pricing options for different use cases and definitely you <strong>pay only for the compute time</strong>.
Below are the categories :

#### On Demand Instances

On-Demand Instances are ideal for short-term, irregular workloads that cannot be interrupted. Use cases for On-Demand Instances include developing and testing applications and running applications that have unpredictable usage patterns.

#### Reserved Instances

Reserved Instances are a billing discount applied to the use of On-Demand Instances in the account. At the end of a Reserved Instance term, one can continue using the Amazon EC2 instance without interruption. However, they charge On-Demand rates until any action is taken.

#### Savings Plan

Amazon EC2 Savings Plans are ideal for workloads that involve a consistent amount of compute usage over a 1-year or 3-year term. With Amazon EC2 Savings Plans, you can reduce your compute costs by up to 72% over On-Demand costs.

#### Spot Instances

Spot Instances are ideal for workloads with flexible start and end times, or that can withstand interruptions. With Spot Instances, you can reduce your compute costs by up to 90% over On-Demand costs. Unlike Amazon EC2 Savings Plans, Spot Instances do not require contracts or a commitment to a consistent amount of compute usage. 

#### Dedicated Hosts

Dedicated Hosts are physical servers with Amazon EC2 instance capacity that is fully dedicated to your use. On-Demand Dedicated Hosts and Dedicated Hosts Reservations can be purchased. Of all the Amazon EC2 options that were covered, Dedicated Hosts are the most expensive. I will highlight on the diffference between <strong>Dedicated Hosts and Dedicated Instances</strong> later.


![image](https://user-images.githubusercontent.com/88903134/180647376-6798deeb-c003-4732-b9d9-9ee565add460.png)



That's it for today!! Next day I will be discussing on Scaling and Elastic Load Balancing. And I am extremely excited for this.