AWS EC2 Explained: A Beginner’s Guide to Cloud Computing & Instance Types
Hi there! 👋
I’m Dhyuthidhar, and if you’re new here, welcome! I love exploring computer science topics, especially machine learning, and breaking them down into easy-to-understand concepts. Today, let’s continue to talk about EC2. 💿
With Amazon EC2, it is much easier to get started with developing your software, as AWS will take care of the hard part already.
AWS builds and secures data centers, purchases, and installs servers, and makes them ready for users to rent. This saves users from building their own infrastructure and the costs that come with it.
You can rent part of EC2 as an instance and utilize its computation capacity. The instance will be your server, and EC2 will host it.
EC2 runs on top of physical host machines managed by AWS using virtualization technology.
EC2 uses a technology known as “multi-tenancy.”.
What is multi-tenancy?
I will take you through an apartment analogy: EC2 is the apartment name, and the flats in the apartments are the EC2 instances, which are owned by the EC2 owner (landlord) (AWS). He will rent you the flats for a certain cost. Sharing resources like lifts, stairs, basement parking, etc is known as multi-tenancy
Let’s say you want to spin up an EC2 instance; then you won’t rent the whole physical machine to get the server; there will be a part of the physical machine that will be given to you as the server, and that physical host machine gives multiple parts to multiple users as a “virtual machine.” There is a hypervisor under the hood running on the host machine that shares the resources between all the users (virtual machines). This idea of sharing resources is known as “multi-tenancy.”.
What is a virtual machine?
VMs are invisible computers that run as isolated instances on a physical machine, using an OS as their software.
A physical machine consists of multiple virtual machines.
These are managed by the hypervisors. And the hypervisor is managed by AWS.
AWS uses a specific hypervisor known as “Nitro“.
Every EC2 instance is isolated, as it is managed by the hypervisors. These hypervisors ensure that every instance shares resources and is isolated. Thus, every EC2 instance, which is your server, is secure.
Not only can you spin up or stop using EC2 instances, but you also have other flexibility options and control over your instances by making changes to the configurations of those instances.
When you spin up an EC2 instance, you have the option to choose the operating system of the instance whether it is Linux or Windows.
What are the configuration options for EC2?
These are some of the configuration options you get if you spin up an EC2 instance:
Operating System: You can choose what operating system you want, including Windows and Linux. You can spin up multiple instances with a blend of different OS’s.
Choosing the Software: You can choose what software you want to run inside the EC2 instance. It can be your internal business, web app, etc.
Size of the Instance: You can choose the size of the instance if you want more compute capacity; you can make changes to the CPU and the memory of the instance. This is called vertical scaling. You can also do the horizontal scaling by provisioning more instances.
Networking Aspect: What type of request do you want to make to your server? You can choose whether you want it public or private, etc.
AWS made virtual machines that are much more flexible and cost-effective for you to acquire services through this compute-as-service model (CAAS).
Different Types of EC2 Instances
EC2 instances are the employees that serve the client’s request.
And we can go back to the coffee shop analogy, and let’s say we want to have multiple employees to make our cafe work. But not all those employees will be barristers; some of them should be cashiers, barristers, etc.
For every business, there is a variety of tasks to develop software, and those tasks are divided equally among the employees in the company. The tasks are also divided. So for that, we need multiple employees who work on different tasks and have different skill sets.
In the same way, we need different EC2 instances for different tasks that have different skill sets.
The process of scaling up multiple EC2 instances is known as horizontal scaling.
Each EC2 instance type is grouped under an instance family and is optimized for certain types of tasks.
Instance types differ in varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications.
Let’s talk about the types:
General Purpose:
It provides a good balance of computing, storage, and networking resources.
Web servers, code repositories, and other workloads can benefit from it.
It gives equal volume of everything (computing, storage, and networking). So if less computation is necessary, then go for this type of EC2 instance.
Examples: T2. micro, M6a instance, M5 instance, M8g instance, etc.
Compute Optimized Instance:
As the name says, it is efficient in the process of computing.
If your software requires high-performance computation, then you can go for this option.
Software like video gaming, graphics editing, ML models, etc., can utilize this type of instance.
Examples: c5d.24large, c5a, etc.
Memory Optimized Instance:
As the name says, it is efficient for the memory-intensive tasks.
If your software needs real-time processing or speedy tasks, then you can try this type.
Tasks like database queries and real-time processing of databases need this type of instance.
Examples: R7g.medium, R8g, etc.
Accelerated Computing:
As the name says, it utilizes hardware accelerators to speed up the processes.
Co-processors are used to accelerate the computation processes.
Tasks like data pattern matching and graphic processing or floating-point calculations can use this type of instance.
Examples: P1, Inf2, G5, G5g, etc.
Storage Optimizers:
Workload that requires high performance for the locally stored data, like huge datasets.
It accelerates the read-and-write access process.
Used for OLTP systems, etc.
Examples: Im4gn, i8g.large, etc.
Let me explain to you the above types using the previous analogy of the coffee shop that I used in my previous blog.
Cashier → Memory-optimized instance.
Barristers → Compute Optimized Instance.
Latte Art Employee → Accelerated computing instance.
Conclusion:
We learned about what an EC2 instance is and what the technology is that it uses, which is multi-tenancy. and explored configurations like vertical and horizontal scaling on EC2. What are the types of EC2 instances, and where do we use them? In the next blog, I will explain the billing options and other services that are given by AWS in a simple way.
What If You Could Skip the Headaches?
Imagine working on your dream project, but instead of worrying about servers, wiring, and maintenance, you focus on what truly matters—your idea.
This is why cloud computing exists. It eliminates the struggle so you can innovate, grow, and build without barriers.
🚀 Curious about cloud computing? Try it yourself!
👉 Sign up for AWS Free Tier, launch your first EC2 instance, and experience the power of the cloud firsthand!
📚 Also, check out the AWS Practitioner: Essentials course on Coursera.
Why I Share This
Simon Squibb believes that the best way to share knowledge is to make it simple and accessible. And that’s exactly what I do—I break down complex tech into something easy and exciting.
Tech should inspire you, not intimidate you.
Imagine a world without the cloud—every startup would need huge investments just to get started. AWS changed that game. The cloud lets anyone with an idea build something incredible without worrying about infrastructure.
I share knowledge this way because I want you to feel that excitement too.
If this post made you think differently about tech, check out my other blogs. Let’s make tech easy and exciting—together! 🚀