What serverless architecture is?
Despite the name, serverless architecture (also known as serverless computing) doesn’t mean that no servers are used. Servers are essential to host software applications on the Internet, therefore, serverless architecture can be considered as a different way of dealing with server infrastructures. Also, there’s no similarity between the serverless architecture and the peer-to-peer (P2P) computing which functions without any servers. As an extension of cloud computing, serverless architecture has become an innovative trend in the IT industry. So, what does the serverless architecture or serverless computing really means? As for many IT trends, there’s no fixed definition for this technology. Simply put, in serverless architecture, developers could write and deploy code without focusing on server-side operations. Traditionally, when hosting a software application on the internet, apart from writing codes, developers are getting involved to manage the server hosting processes. But when you go serverless, cloud providers are responsible for managing, provisioning and maintaining the servers and by that, developers could completely concentrate on application code.
As a part of an innovative technological trend, it’s interesting to know the evolution of the serverless architecture. In the beginning, companies had to manage their own physical server infrastructures and application codes. They had to set up hardware which requires to run server software and then install operating systems. When companies have grown in size, they required more servers to deploy their applications and it was expensive to install the extra bare-metal servers. Then the virtualization came as a solution to these newly emerged issues. Virtualization allows us to create multiple virtual machines (VM) that run different operating systems but still share the same hardware components. Later, the invention of high-speed internet connectivity led to the cloud computing architecture where virtualization served as a fundamental technology behind it. Cloud providers had developed infrastructure platforms that could perform the server-side functions as exactly as the physical servers. This approach led to the two important cloud computing models namely Infrastructure-as-a-Service (IaaS) and Platform-as-a-Service (PaaS). These models have facilitated developers to get detached from server-side operations. But, problems have raised when application deployment change from one platform to another and then, containers have introduced as a solution for them. As Docker defined, a container is a lightweight, standalone and executable software that packages up code and all its dependencies. In contrast to the virtual machine's approach, containers virtualize at the operating system level. Finally, serverless architecture made it possible for developers to properly focus on application code while completely get detached from server-side operations.
Serverless architecture also refers as Function-as-a-Service (FaaS), has some significant features over previous technologies. Since the code stored in clouds is triggered only after the occurrence of an event, server-side resources only use in case of responding to an event. In traditional web application architecture, servers have to run around the clock to handle the requests received from client applications. Companies have to spend lots of money to maintain these always-on servers and it’s also a waste of energy and resources as well. The pay-per-use approach of serverless architecture reduces the cost of server usage by charging only for the time period that functions are running. If there’s no computing work perform by servers then no charges will be added and the scaling process is automatic, so depending on the traffic, it will scale up or down.
This term got popularized after Amazon introduced its serverless computing service, AWS Lambda in 2014. Chris Munns, principal developer advocate for serverless at AWS, has mentioned about the serverless architecture in a conference that,
"There are no servers to manage or provision at all. This includes nothing that would be bare metal, nothing that's virtual, nothing that's a container -- anything that involves you managing a host, patching a host, or dealing with anything on an operating system level, is not something you should have to do in the serverless world."
After AWS Lambda, other cloud computing platform providers also launched their serverless services such as Google Cloud Functions, Azure Functions, IBM OpenWhisk, Alibaba Function Compute, and Oracle Fn Project.
Benefits of serverless architecture
- Developers don’t have to deal with the servers, cloud service providers take care of all server-side operations. They can spend all their time on code and it will increase their productivity. It also reduces the future investment on DevOps.
- Companies don’t have to spend much on servers as in traditional application deployment. In traditional approach, there’s a fixed cost that has to pay for the server allocation regardless the resources are used or not. Practically, most of the backend servers stay idle when there’s no computing work. Serverless facilitates companies to pay only for the usage of resources.
- Automatic scaling is one of the key features of serverless architecture which is useful when coping with the growing number of requests.
- Since there are no server-side operations to perform, it’s easy for developers to just upload the code and deploy applications. It’s also possible to simply apply new updates as well. Instead of making changes to the whole application, developers can apply updates separately to each function.
Drawbacks of serverless architecture
- Since developers don’t have access to backend processes, application testing and debugging is more complex than the traditional approach. Sometimes developers have to set up their own simulated environment for testing purposes.
- Risk of vendor lock-in. The serverless market is dominated by few cloud service providers and if a company chose one service provider, all their backend processes will be managed by that provider. Therefore, it’s difficult to switch to other service providers because the server infrastructures of other vendors may differ from the current vendor.
- Sometimes, it’s not cost-effective to use serverless architecture for long-running processes.