Serverless Architecture

What, no server????

Despite the meaning of the name “Severless Architecture“ it does not mean hosting a web site or a web service without a server. It basically means that the owner or the hosting person of a web site does not have to buy or rent server components to run his service. A common example for this is hosting services with AWS lambda. AWS Lambda is sever less computer services which run the back end code according to the requirements and manage the underlying layers of the service for you dynamically.

In AWS lambda the four main principles that are highlighted are

· Simple but usable primitives (small, usable building blocks).

· Scales with usage (servers are auto scaled).

· Pay-only usage (Pay only for the time using services).

· Built-in availability and fault tolerance

In this architecture style some back end code is written by the developer. But unlike traditional server code executions, This runs in a stateless computer containers which are triggered according to the occurrence of the event.

The term ephemeral refers to the fact that these last only for one invocation. These container invocation and the management is 100% carried out by the third party.

BaaS

Severless architectures refer to applications that significantly depend on third-party services (knows as Backend as a Service or “BaaS”) or on custom code that’s run in ephemeral containers (Function as a Service or “FaaS”)

When developing a BaaS shaped service application, it is possible that you need some custom code to run on the back end. To achieve this certain FaaS are available such as Validation, image manipulation etc.

So what’s the difference?

For an example let’s take a UI driven application. To elaborate this furthermore let’s take a scenario of a Shopping web site which includes the following functionalities

1) User Log in (Authentication)

2) Product Browsing/ Searching

3) Purchase

As per the normal method all these functions will be handled by a single standing server. So the overall architecture will look something like this.

Typical Server Architecture

With this method the client browser can be unintelligent because all the required processes are managed by the server such as log in, purchase and browsing.

But with the severless architecture this design evolves to a complex yet dynamic design.

Serverless Architecture

· In this style the Authentication part or the user validation logic has been removed from the server and has been handed over tto a third party BaaS service.

· Some functions that were previously in the server are now in the browser such as maintaining a session, UI/UX structuring, pagination logic etc. Since UI/UX function take upa lot of resources (compute intensive) it has been handed over to a FaaS by a third party. They respond to the cline t via the API. We can have both the client, and the server function, read from the same database

· The search function or the browse function (AMA) has been handed over to another third party database.

· The purchase function has also been handed over to another FaaS. The advantage of this is rather than re implementing the entire logic for purchasing, it is easier and secure to hand it over to another service which is secure and efficient.

Up’s and Down’s

When the Severless Architecture is followed the following advantages can be obtained

1) Simplifies deployment and packaging.

2) Decreases the complexity of software.

3) Since it fits well within micro services as they can be implemented as functions.

4) Smaller development and operational costs.

5) Faster and rapid software releasing

Although there are many disadvantages to this architecture there are certain disadvantages too.

There is a slight possibility to have some performance issues. And there are problems in debugging and monitoring of serverless computing which has proven to be tricky and challenging. The monitoring of the system will be difficult since a single server is utilized

Conclusion

The Severless architecture is a modern approach to deploying as well as writing applications that enables developers to focus more on the code. This kid of approach can decrease time to market, system complexity and operational costs. While the third-party services like AWS Lambda are leveraged by AWS to eliminate the need to set up as well as configure virtual machines or physical servers, it also locks in the application as well as its architecture to the particular service provider. This architecture will help to simplify the development process and simplify the hosting as well.