Everything about AWS-1 : EC2 Instances

Priyanka Banerjee
4 min readAug 16, 2021

What is AWS?

AWS is Amazon Web Services, a subsidiary of Amazon that provides several APIs and Cloud Computing Platform for our needs.

Now before diving deeper, let us understand what is an API

An API or application programming interface is a connection between servers and clients or between 2 or more servers.

API

Example: An user has a requirement to search a hotel, so he will raise a request from a mobile app (client) to the application server. The server responds back to the client with a list of hotels. The connection that takes request from the client to the server and delivers the response back to the client from the server, is called an API.

client-server communication through an API

As more people are accessing several applications, the amount of data that each company is receiving is huge. All these data need to be stored on server. To store such huge amount of data, large computers or SERVERS are required. Now here comes the introduction of cloud. Example: You want to launch an application, for that you need to understand and predict how much data your app might produce. Based on several factors you might require computers with high end configurations. These computers are servers. If you plan to buy and maintain them, huge cost is incurred. However, if you think of renting them from places where they already exist, costs will decrease considerably and you can have the freedom to increase or decrease these computers according to the data your app is producing without any maintenance charge. This place is called the “Cloud”. Amazon provides such an amazing feature through AWS platform.

EC2 instances: A virtual instance of an AWS server accessed from your computer, is called an EC2 instance. There can be one or more services that run on an EC2 instance also called as “server” and to access these services, we use an API.

Advantages of an EC2 instance:

a. We can perform vertical scaling based on our requirements, i.e., we can increase memory and CPU of this instance when there’s requirement for huge amount of data and can free up that space when not needed.

b. We can control networking accessibility whether the service endpoints can be accessed publicly or privately

Types of EC2 instances:

  1. General Purpose : Used for no specific intensive tasks
  2. Compute Optimized : For compute intensive tasks like gaming or scientific modeling where high performance processors are required
  3. Memory Optimized : For memory intensive tasks like in high performance databases
  4. Accelerated Computing : Used for graphics processing, data pattern matching, etc.
  5. Storage Optimized : Utilised for high performance of locally stored data like data warehousing applications

Pricing of EC2 instances:

  1. On-demand : Increase and decrease memory as required
  2. Savings Instance : Plan for 1 year or 3 years
  3. Reserved Instance : Taken for 1 year or 3 years and paid through 3 different payment options
  4. Spot Instance : Here, we 90% of On-demand pricing but the catch is AWS can reclaim it anytime with 2mins warning
  5. Dedicated Hosts : Physical hosts that are not shared with others to meet specific compliance requirements

Amazon CloudWatch provides real-time data of resource utilization of EC2 instances to the customers via logs and events. This further helps in Autoscaling, i.e., automatic addition or removal of EC2 instances.

Autoscaling :

  1. Dynamic scaling : Responds to a change based on demand
  2. Predictive scaling : Schedules required instances based on predicted demand

Web traffic gets automatically distributed across one or more EC2 instances equally through a single point of contact, known as Elastic Load Balancer (ELB), that provides availability and robust security along with autoscaling feature.

Availability:

If a business has EC2 instances running in one location, due to certain unseen natural disaster, ruckus can be caused on those servers, as a result the business might end up losing all its data. AWS has lots of Data Centers throughout the world. Therefore, it is advisable to have more than one EC2 instances running in different regions.

If there are customers in Mumbai but the data is hosted in Ohio, we don’t need to send requests always from Mumbai to Ohio to access that data instead we can cache a copy locally in Mumbai. This process is called content delivery networks(CDN) and in AWS it is known as Amazon CloudFront. This process helps in decreasing latency and increases transfer speed. In extreme cases there can be requirements where a business might want to use AWS services inside their own building, we use AWS Outposts where AWS installs a mini region inside their data center.

Accessibility:

There are various services that AWS provides. To interact and access these services we can either use Console(GUI) or Command Line Interface(CLI) or AWS Software Development Kit(SDKs). Tools that help us to manage AWS environment are-AWS Elastic Beanstalk and AWS CloudFormation.

  • AWS Elastic Beanstalk: If we provide our application code and configurations, it uses this information to build out the EC2 based environment for us. It also enables to save this environment configuration for easy deployment and reusable purpose.
  • AWS CloudFormation: This is a tool that allows to define several AWS resources in JSON/YAML text based document called CloudFormation template where we just need to specify what we want to build.

Conclusion:

Stay tuned to learn more on serverless instances and AWS container orchestration tools that I will cover in Part 2.

--

--

Priyanka Banerjee

Sr. Data Scientist | Work in Finance & Health Domain | Keep Learning, Keep Sharing.