Amazon Elastic Compute Cloud(EC2)

Jinali Pabasara
Apium Innovations
Published in
5 min readFeb 24, 2022

It’s necessary to have a proper understanding of AWS services in order to build and deploy services on AWS. One of the most common uses is Compute in AWS. Amazon provides 3 fundamental compute options for us to use memory and processing power. Virtual Machines, Container Services, and Serverless are the compute options AWS provides.

This article is a high-level overview of the Amazon Elastic Compute Cloud(EC2).

Amazon Elastic Compute Cloud(EC2)

Amazon provides virtual machine compute options through the Elastic Compute Cloud service. In AWS compute service, virtual machines are called EC2 instances. One of the most important features of EC2 is that we can use AWS management console, AWS CLI, AWS SDK, and infrastructure orchestration services to create and manage these EC2 instances. AWS EC2 service can consider as one of the most secured and resizable compute capacities in the cloud.

These EC2 instances run on top of physical host machines that are managed by Amazon using virtualization technologies. When we want to launch an EC2 instance instead of taking an entire host machine to ourselves we share the host machine with other virtual machines (EC2 instances). There is a hypervisor running on the host machine which makes it possible to share the underlying physical resources between EC2 instances. More importantly, it isolates virtual machines from each other when sharing physical resources.

There are various types of software we can run on EC2 instances such as internal business applications, simple web apps, complex web apps, databases, or third-party software like enterprise software packages.

EC2 Instance lifecycle

Amazon Elastic Compute Cloud instances are a combination of Virtual processors, network, memory, instance storage, and graphic processing units. When we are launching an EC2 instance we need to determine and configure how much we need from each of these components.

With Amazon EC2 we only pay for the server capacity we need. In other words, we only pay for the compute time we use when EC2 instances are running. We don’t pay for stopped or terminated instances.

Amazon EC2 auto scaling is a feature that enables us to automatically add or remove instances according to the changing of our application demand. With that, we can automatically scale in and out our instances as we need.

There are two approaches we can take when it comes to EC2 auto-scaling. In order to scale faster, we can use both of these approaches together.

  1. Dynamic scaling is responding to the changing demand of our application
  2. Predictive scaling is automatically scheduling the number of EC2 instances based on predicted demand

When we are configuring our EC2 instance, the first step is to select an AMI that suits our application requirements. Next will take a look at Amazon Machine Image (AMI).

Amazon Machine Image (AMI)

AMI

Amazon Machine Images are templates of pre-configured EC2 instances.AMI allows us to select necessary Operating system type, storage mapping, architecture type, and many other additional software.

The relationship between AMI and EC2 instances is similar to class and objects in OOP. we can launch multiple EC2 instances from a single AMI. in that case we can consider EC2 instances as the live instantiations of what is defined in an AMI. With the help of AMI, we can launch EC2 instances quickly and easily.

There are several ways to find these Amazon Machine Images according to our requirements.

  • Premade AMI from Amazon
  • AMIs created from our EC2 instances
  • AWS marketplace AMIs

After selecting an AMI the next step is to select a suitable EC2 instance type. Next, let’s take a look at the EC2 instance types available in AWS.

EC2 instance types

we need to consider the requirement for compute, memory, and storage capabilities when selecting an EC2 instance type.

  • General-purpose instances

This instance type has a balance of compute, networking, and memory resources. When our application needs roughly equivalent amounts of compute, networking, and memory we can select general-purpose EC2 instances.

Use cases of general-purpose instances

1. application servers

2. gaming servers

3. backend servers for enterprise applications

4. small and medium databases

  • Compute-optimized instances

This type of instance is suitable for compute-bound applications which can be benefitted from high-performance processors.

Use cases of Compute-optimized instances

  1. high-performance web servers
  2. compute-intensive applications servers
  3. dedicated gaming servers
  4. batch processing workload
  • Memory-optimized

These types of instances are suitable when there is a workload that processes large datasets in memory in order to get fast performance. Memory-optimized instances are suitable for memory-intensive applications.

Use Cases of Memory-optimized instances

  1. Open-source databases
  2. In-memory caches
  3. Real-time big data analytics
  • Accelerated computing

These use hardware accelerators (components that can expedite data processing) to perform functions in a more efficient manner.

Use cases of Accelerated computing instances

  1. graphics applications
  2. game streaming
  3. application streaming.
  • Storage optimized

These instance types are designed to provide high sequential read and write access to larger data sets. This has been optimized to provide a larger amount of low latency, random I/O operations per second.

Use cases of Storage optimized instances

1. distributed file systems

2. data warehousing applications

3. high-frequency online transaction 4. processing (OLTP) systems

There are various benefits of using AWS EC2 instances as we discussed in great detail.

  1. EC2 instances are highly scalable as we can select instances with the necessary amount of RAM, CPU..etc
  2. EC2 instances are easy to start and stop.
  3. Customers only need to pay for the running instances, not for the stopped or terminated instances
  4. Customers get the chance to select EC2 instances from various platforms
  5. EC2 instances pricing plan enables customers to select the most affordable and suitable instance to run their solutions.

Read more

Commonly Used AWS Services

At Apium Innovations we build world-class software products while following the best practices in DevOps, follow us to learn more.

Thank you for reading!

--

--

Jinali Pabasara
Apium Innovations

Software Engineer | Tech Enthusiast | AWS | NodeJS | Typescript