This write-up is an insight into cloud instances. In the cloud computing universe, we hear this term all the time: instances spinning up based on the demand, instances going down and such.
I’ll cover all the frequently asked questions on it such as what is an instance? What is the difference between a server and an instance? What is an instance life cycle? Why do instances need attached persistent storage? etc.
So, without further ado.
Let’s jump right in.
1. What is an instance in cloud computing?
In very simple words, a server running our application is called an instance. Think of one server as one instance.
An instance is a virtual machine that runs our workloads in the cloud. Often the terms VM (Virtual Machine) & instance are used interchangeably.
The term server and instance can also be used interchangeably but in the cloud computing universe, the term instance is preferred over server.
Instances in the cloud spin up and down all the time depending on the requirements of the workload. This is commonly known as auto-scaling.
Our workload can be hosted by a single instance or may require a number of them grouped together in a cluster. They can also be spread out geographically in different cloud availability zones provided by the cloud provider.
Simplifying it even further, imagine a simple CRUD-based app hosted by an Apache Tomcat server on our local machine.
Now when we deploy that app to the cloud, in cloud computing jargon that app becomes the workload & the apache server becomes an instance.
Instances have no dependency on the workload & vice versa. Both are loosely coupled. This allows them to spin up & down as per the demand.
Also, with no dependency, the workload becomes more portable. It can be moved around from on-prem to the cloud & across different cloud platforms without much fuss.
Using instances in different ways such as making them redundant, and replicating them, makes our systems fault-tolerant. This helps us achieve high availability.
Mastering the Fundamentals of the Cloud
If you wish to master the fundamentals of cloud computing. Check out my platform-agnostic Cloud Computing 101 course. It is part of the Zero to Mastering Software Architecture learning track, a series of three courses I have written intending to educate you, step by step, on the domain of software architecture and distributed system design. The learning track takes you right from having no knowledge in it to making you a pro in designing large-scale distributed systems like YouTube, Netflix, Hotstar, and more.
Instances are virtual machines that run the images of operating systems like Linux or Windows. We can also create custom images as per our requirements or import existing images & run them on the cloud instances.
Instances can also run containers with container-optimized operating systems. Instances have templates that help us clone new instances with the existing configuration saving us a lot of time. With them, when deploying our workloads on the cloud, we can quickly pick and modify the hardware properties of our instances, such as the number of virtual CPUs, memory, storage capacity, etc.
Instances are categorized into several different types by the cloud providers where each category of instances serves certain specific use cases. What are their types? Let’s find out up next.
2. What are the different cloud instance types?
Instances are classified based on their hardware capabilities such as CPU power, disk storage capacity, memory size etc. Below are the Instance types commonly offered by cloud providers:
Standard instances
These Instance types are configured for general use cases such as running web servers, microservices etc. They have a balance between the resources allocated to them such as CPU, memory etc.
High CPU instances
These instances are specifically built to provide high computing power to run compute-intensive workloads such as running distributed analytics, batch processing, machine learning algorithms, scalable multi-player gaming, graphics rendering, etc.
High memory instances
These instances are built for running memory-intensive workloads such as real-time data ingestion, big data analytics, high-performance databases, running distributed in-memory caches etc.
Instances with GPU
These instances provide the power of the GPU required for advanced computing such as running data-intensive machine learning algorithms, data processing, 3D rendering, animation, virtual reality applications, autonomous vehicles, fluid dynamics, blockchain computations etc.
3. What are preemptible instances?
Businesses can use preemptible instances at a lower rate than the regular instances offer with some trade-offs. This is primarily because their availability is not guaranteed at all times. Cloud providers offer these instances based on their availability, these instances can be terminated at any time from our workload & be allocated to other high-priority tasks.
Use cases suitable for preemptible instances are stateless tasks such as batch processing, image compression back-end process etc. These tasks are not so mission-critical and are resilient to failures. Even if the deployed instances are terminated & pulled away, slowing down of these tasks does not impact the service as a whole.
There are other limitations involved with preemptible instances as well though they vary from provider to provider.
4. What is an instance group?
An instance group is a group of instances running together as a single entity ideally in a cluster.
Putting instances together in a group makes enforcing policies & configuration easy. Policies and rules can be about high availability configurations, auto-healing, load balancing, applying updates etc.
Managing instances in specific geographic availability zones becomes easier too.
5. Why do instances need persistent storage?
Instances have persistent memory attached to them that can be augmented based on the requirement. This helps retain the running state of an instance in case it fails and goes down.
New instances spinning up can access the running state from the persistent storage and continue the task without having the end user notice the instance swap.
6. What is an instance life cycle?
Right from the point in time an instance is provisioned, it goes through various stages in its life cycle such as being provisioned, staged, being in the running state, being stopped, terminated & spinning up again.
Let’s quickly go through the different stages of an instance’s life cycle.
Provisioning – In this stage, the instances are not running yet. They are allocated to run a workload based on a set of rules and configurations.
Staging – Cloud resources get allocated to an instance in this stage. The instance gets prepped up for launch.
Running – The instance starts hosting the workload. If multiple instances are already running in the cluster, the new instance shares the load with other already running instances.
Terminated – The instance is down either due to failure or manually done by the user. It can be reset, restarted or deleted at this stage.
7. What are single & multi-tenant instances? What is the difference between them?
Tenant in computing means a user. So, a single tenant would mean a single user and a multi-tenant would mean multiple users.
In the context of cloud instances, a single tenant instance means an instance running the workload of a single customer. No sharing of resources with any other customer.
You can think of a bare metal server in the context of a single-tenant instance.
A bare metal server is one physical hardware that is utilized by one customer. The customer may run their multiple workloads on the single tenant bare metal server but still, it would be used by just one customer.
Bare metal servers are typically used when running their workloads on-prem.
On the contrary, think of virtual machines in the context of multi-tenant instances.
Virtual machines run the workload of multiple customers in the cloud, the resources are shared between several different customers which sometimes leads to a noisy neighbor problem.
A noisy neighbor problem occurs when the workload of one customer in a shared resource environment causes negative performance effects on the workloads of other customers. It may consume a big chunk of shared machine resources affecting other workloads.
Hypervisors are getting pretty advanced for this but still, they don’t eradicate this problem by cent percent.
A single-tenant instance is dedicated to a customer and can be utilized for data-intensive workloads for better performance. And since it is just for one customer, naturally, it will have high costs associated with it.
Also, single tenant instances are not exclusive to on-prem setups, they are also offered by the public cloud platforms such as Google Cloud.
There are certain spaces like finance where businesses prefer to run their workloads on single-tenant instances, this makes their setup more secure and in adherence to the industry security compliance.
Well, Folks!! This is pretty much it. If you liked the article, share it with your network for better reach. You can read about me here.
Check out the Zero to Software Architecture Proficiency learning path, a series of three courses I have written intending to educate you, step by step, on the domain of software architecture and distributed system design. The learning path takes you right from having no knowledge in it to making you a pro in designing large-scale distributed systems like YouTube, Netflix, Hotstar, and more.
I’ll see you in the next write-up.
Until then.
Cheers!!
Shivang
Related posts
Zero to Software Architecture Proficiency learning path - Starting from zero to designing web-scale distributed services. Check it out.
Master system design for your interviews. Check out this blog post written by me.
Zero to Software Architecture Proficiency is a learning path authored by me comprising a series of three courses for software developers, aspiring architects, product managers/owners, engineering managers, IT consultants and anyone looking to get a firm grasp on software architecture, application deployment infrastructure and distributed systems design starting right from zero. Check it out.
Recent Posts
- System Design Case Study #5: In-Memory Storage & In-Memory Databases – Storing Application Data In-Memory To Achieve Sub-Second Response Latency
- System Design Case Study #4: How WalkMe Engineering Scaled their Stateful Service Leveraging Pub-Sub Mechanism
- Why Stack Overflow Picked Svelte for their Overflow AI Feature And the Website UI
- A Discussion on Stateless & Stateful Services (Managing User State on the Backend)
- System Design Case Study #3: How Discord Scaled Their Member Update Feature Benchmarking Different Data Structures
CodeCrafters lets you build tools like Redis, Docker, Git and more from the bare bones. With their hands-on courses, you not only gain an in-depth understanding of distributed systems and advanced system design concepts but can also compare your project with the community and then finally navigate the official source code to see how it’s done.
Get 40% off with this link. (Affiliate)
Follow Me On Social Media