Serverless Computing

Serverless Computing is a computing model where servers are not used. Are you kidding me? You are right. This is not a case. Serverless Computing is actually a misnomer. What it really means is developers are freed from managing the servers and are free to focus on their code/application to be executed in the cloud.

Serverless Computing
Serverless Computing – You won’t need such a huge space!!

So, how does Serverless Computing really work?

In this computational model, you only need to specify minimum system requirements such as RAM. Based on that the cloud provider would provision the required resources such as CPU and network bandwidth. Whenever you need to execute your code, you hit the endpoint and your code is executed. In the background, the cloud provider, provisions the required resources, executes the code and releases the allocated resources. This allows cloud provider to use the infrastructure for other customers when they are idle. This also gives out the benefit to the customers as they are not charged for the idle time. Win-Win situation for both, isn’t it?

Serverless Computing is popular in microservices architecture. The small pieces of code which form the microservices can be executed using Serverless components very easily. On top of it, cloud provider also handles the scaling up. So if there are more customers hitting your serverless endpoint, cloud provider would automatically allocate more resources and get the code executed.

Any precautions to be taken?

Absolutely. Every developer needs to keep few things in mind while developing code for Serverless computing:

  • The code can’t have too many initiations steps, else it will add to the latency.
  • The code is executed in parallel. So there shouldn’t be any interdependency which would leave the application or data in the incoherent state.
  • You don’t have access to the instance. So you can’t really assume anything about the hardware.
  • You don’t have access to local storage. You need to store all your data in some shared location or central cache.

So who all provide this option?

  • AWS (obviously!!) was the first one to provide this (2014) – AWS Lambda.
  • Microsoft Azure provides Azure Functions
  • Google Cloud provides Google Cloud Functions
  • IBM has OpenWhisk which is open source serverless platform

Support for languages varies from provider to provider. However, all of these offerings support Node.js. Among other languages, Python, Java are more popular.

Related Links

Related Keywords

Serverless Architecture, API Gateway, AWS S3, Microservices Architecture

VPC – Virtual Private Cloud

When you are hosting your application in the cloud, you would be worried about the security of your resources in the cloud, especially data in transit. No one would want their data to be snooped or would not want unauthorized access to their servers which are in the cloud. For such scenarios, VPC i.e. Virtual Private Cloud comes into the picture.

Virtual Private Cloud is essentially an isolated network (logically) from other tenants’ network on the cloud. VPC is a terminology introduced by AWS, however, other IaaS providers also have similar concepts. In Google Cloud also you get “Virtual Private Cloud”, however in Azure, you get “virtual network”.

Key features of VPC

Since this is your own private network in the cloud, you get a lot of control in configuration and implementation. One can define subnets, routes, network ACL (access control lists). Additionally, you also get control of which subnets can have access to the internet and which do not.

In VPC, the network administrator can set up their resources such as virtual machines, containers or databases. These resources could be in a single subnet or multiple subnets. There could be routes defined which will allow only certain subnets to access a given subnet. This gives a very good control to the network administrator over her network.

Typical VPC implementation in AWS

AWS VPC Implementation
AWS VPC Implementation (Source: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Introduction.html)

Are there any differences in VPC by AWS and Azure?

Although they are very similar in concept, VPC in AWS and Virtual Network in Azure have some differences.

  • AWS provides a wizard to create Virtual Private Cloud with 4 different basic options. Azure doesn’t have a wizard.
  • AWS allows you to use Security Groups and Network ACL both to control access. However, in Azure, you can use only one of them at a time.
  • AWS provides custom routing tables to control access within the VPC. However Azure doesn’t have such feature.

Related Links

Related Keywords

AWS, Cloud, Azure, Virtual Network, Google Cloud

API Gateway

API Gateway is a server that is a single entry point to your system. As you can imagine, primary function of this server is provide various API endpoints to various clients. It also hides the backend services from the client.

Why should I use API Gateway?

Consider a complex architecture where variety of clients are accessing your system. In this age, monolithic applications are getting outdated whereas microservices based applications are popular because of their efficiency and maintainability. As a result, all of the clients will need to make several calls to get data from various services from your system. So even to render one page, client will end up making several calls. This would be a problem on mobile network, which typically has latency issues. To add to this complexity, each client could have their own requirements. That could also mean client specific code.

All these problems can be solved by implementing an API Gateway. This server provides single point of reference for all the clients. It detects the client and breaks the request into multiple backend requests to fetch the data. This gives additional benefit of consolidating responses from all the backend requests into single response for the client.

API Gateway simplified diagram
API Gateway [Source: https://www.nginx.com/blog/building-microservices-using-an-api-gateway/]

Are there any drawbacks?

Yes, as is the case with almost everything in life! If due care is not taken, API Gateway itself can become bottleneck and heavy. All developers would be required to update API Gateway whenever they make changes to the endpoints or protocol to access their respective services. API Gateway gathers data from multiple webservices. As a result, failure of even one service could lead to unavailability of entire service. Or it could add delays in response to the client.

However, there are already ways to counter these drawbacks. Proper process such as DevOps could lead to removal of API Gateway becoming developer bottleneck. Usage of circuit-breaker libraries such as Netflix Hystrix could avoid overall service breakdown even in case of partial service outage.

Reference Links:

Example Implementations / Providers:

  • AWS API Gateway
  • Azure API Management
  • Vertx
  • JBoss Apiman

Related Keywords

Microservices Architecture, AWS, Azure, Hystrix

Hypervisor

Hypervisor means supervisor of supervisor – a strong supervisor. It is hardware or software, which allows to create and control one or more virtual systems. Hypervisor are also known as Virtual Machine Monitor(VMM).

A computer, on which Hypervisor runs, is called as “Host Machine”. The operating system is referred as “Host OS”. Hypervisor allows to create one or more virtual systems on top of Host Machine’s hardware. Each virtual system may have different operating system. Such operating system is referred as “Guest OS”.

The need to use hardware more efficiently gave rise to the Hypervisors. They emulate the underlying hardware for the virtual machines as per the configuration.

It is easy to confuse VMs with Containers, however, there is clear differentiation between these two entities. VMs bundle operating systems within them whereas Containers do not.

Types of Hypervisor

  • Bare-Metal – This layer is installed directly at hardware level and doesn’t have any Host OS at all. It directly allows to install guest operating systems. These type of Hypervisors obviously give speed and efficiency as they work directly off the hardware. They give deterministic response times, smaller memory footprint and fine grained control.
  • Hosted – These reside on top of host operating system. These are preferred where speed has lesser consideration, but manageability requirement is higher. Additionally, these are available on a wider range of underlying hardware and are  easier to setup and install.

Type-1 and type-2 hypervisor - By Scsami (Own work) [CC0], via Wikimedia Commons

Examples of Hypervisor:

Opensource XEN, Citrix XenServer, VMWare’s ESX,

References:

Related Keywords:

Containers, Virtualization, Cloud, Paravirtulaization

Containers

Virtualization is a technique of dividing resources of a computer into multiple execution environments. Virtualization can happen at hardware level or at OS Level. Containers are the latest trend in this space. Although the concept is very old, since unix days, this type of virtualization has picked momentum since Docker Inc introduced their technology.

What Are Containers?

Containers provide an isolated space to run a specific application or a set of applications utilizing the underlying Host OS through OS level virtualization. OS Level virtualization allows to run multiple applications “contained” in an isolated space and hence the name. Isolation also provides security.  It would be easy to confuse them with VM (virtual machines).

VMs host their own OS within themselves (Guest OS). They run on top of another OS (known as Host OS) and provide abstraction at hardware level. This guest OS could be different from host OS. They need to bundle all the dependent libraries and applications within and hence turnout to be bulky.

Containers use underlying host OS through OS level virtualization. All the containers running on a given machine need to use the same OS as that of host OS. They can share the libraries with underlying OS and hence turn out to be very lightweight.

Docker Inc. is a leading provider for in this space and has been doing that since 2014.

 

Containers VS VM
(Source: http://www.virtualizationsoftware.com)

As can be seen easily from above diagram, applications running in VM are very bulky as they need to have OS as well bundled with them. Whereas Containers are lightweight and hence multiple instances could be run on single Host OS.

Wikipedia Link:

Container a.k.a OS Level Virutalization

Reference Links:

Primar From Docker – https://www.docker.com/what-container

Comparison with VMs – https://blog.netapp.com/blogs/containers-vs-vms/

Related Keywords:

Virtualization, Hypervisor, Docker, VMWare, Cloud