Compute Generations

2022, May, 18

Explainer

Over the years there has been a lot of change in how a computer program/application gets executed on the servers.

Server any computer that could accept certain types of requests over the network and send responses.

Let's look at the major ways server applications could be run. Recent methods are more economically and efficient in terms of hardware resource utilization

Computer

Using the entire computer to run an application. The problem is the app may not be using the full resources of the computer so it a way they are under-utilized or wasted. Multiple apps cannot be run on single computer as they may need to have the same resource (for example port 80) which cannot be shared. There could also be security issues as one application may have access to resource used by another application if they are on the same machine.

Virtual Machine

We could have a single physical computer and then use a virtualization layer to create multiple virtual machines inside. Each virtual machine can run independently. Sharing of resource is handled by virtualization layer. This leads to better resource utilization as each virtual machine is like a computer. Apps running on each virtual machine will have their own set of resources, so there are no conflicts. The guest operation system in a virtual machine provides all file system, networking, compute, system libraries required to run an application. The drawback is the amout of resource used to run an entire guest operation system is still a lot when compared to resources need by the application.

Container

A container is an isolated process and namespace on a computer that allows execution of an application under it. The container will only have the bare minimum resources to run the application. This eliminates the bloat of running an entire guest operating system. Containers use very less resources (disk space, memory, compute) than virtual machines. Containers are the most usual way of running server application these days. They have become very popular with the wide speard adoption of micro service architecture (designing large application as a group of independently running components).

Serverless

Functions-As-A-Service(FaaS) also more popularly known as serverless. The term 'serverless' could be a little misleading because there are serverless but the app does not have to worry about them. They are even more light weight than containers and are a good fit for certain use cases. FaaS could be simply defined as a small piece of code that runs only when it receives a request. It is more economically than containers as it is billed only for the execution time and memory it used to process each request. On the other hand containers take up resources even when they are not processing any request.