Serverless computing provides backend services on an “as-needed” basis. The serverless provider makes it easy to create and deploy code, without worrying about the infrastructure. The company that uses serverless services is charged according to their computation. It does not need to reserve or pay for a fixed amount bandwidth or number servers. Serverless does not mean that physical servers have been abandoned, but developers don’t need to be aware of them.
Anyone who wanted to create a web app in the early days of the internet had to have the hardware necessary to run it. This is an expensive and complicated undertaking. Then came cloud computing, where fixed numbers of servers or amounts of server space could be rented remotely. Companies and developers who rent fixed units of server space usually over-purchase in order to make sure that there is no spike in activity or traffic which could cause them to lose their application. This means that some of the server space can be thrown away. Cloud vendors have introduced auto-scaling models to address the issue, but even with auto-scaling an unwanted spike in activity, such as a DDoS Attack, could end up being very expensive.
Serverless computing allows developers the flexibility to purchase backend services as a ‘pay-as you-go’ basis. Developers only pay for the services that they use. This is comparable to changing from a mobile data plan that has a fixed monthly limit to one that charges per byte that is actually used.
While there are still servers that provide these backend services to the public, serverless is not the right term. The vendor handles all aspects of infrastructure and server space. Serverless is the ability for developers to work on their projects without worrying about servers.
What are backend service? What is the difference in frontend and backend services?
The frontend and backend are generally the two sides of application development. The application’s frontend is what users interact with and see. This includes the visual layout. The backend, which is hidden from the user’s view, is where data is stored and where business logic and user data are maintained.
Imagine a website selling tickets. A browser window allows users to enter a website address. The browser then sends a request for the backend server. The backend server responds with information about the website. The website’s frontend will then be shown to the user. This can include text, images, or form fields. The frontend allows the user to interact with one of its form fields and search for their favorite music act. Clicking on “submit” will send a second request to the backend. The backend code will check its database to find out if there is a performer with that name. If they do, the date and time and number of tickets available. The backend code will then send the data to the frontend. If so, the frontend will display those results in a way that makes the most sense for the user. Similar to the above, when the user creates a new account and enters the financial information necessary to purchase the tickets, another back and forth communication will take place between the backend and the frontend.
What type of backend services does serverless computing enable?
Most serverless providers offer database and storage services to their customers, and many also have Function-as-a-Service (FaaS) platforms. FaaS allows developers to execute small pieces of code on the network edge. FaaS allows developers the ability to build modular architectures. This makes it more scalable, without needing to maintain the underlying backend.
What are the benefits to serverless computing?
Lower costs. Serverless computing is usually very cost-effective. Traditional cloud providers of backends services (server allocation) often charge users for inefficient space or CPU time.
Simplified scalability. Serverless architecture allows developers to focus on their code and not have to consider policies for scaling up. The scaling of your code is done by the vendor.
Simplified backend codes. FaaS allows developers create simple functions to perform one purpose independently, such as calling an API.
Rapider turnaround. Serverless architecture reduces time to market. Instead of requiring a lengthy deployment process to roll out bug fixes, new features, developers are able to add and modify code in small pieces.
How does serverless compare with other cloud backend model?
A couple of technologies that are often conflated with serverless computing are Backend-as-a-Service and Platform-as-a-Service. They share many similarities but they do not always meet the requirements for serverless computing.
Backend-as-a-service (BaaS). A service model in which a cloud provider provides backend services, such as data storage. This allows developers to focus on writing front end code. BaaS applications might not fulfill these requirements, as they are event-driven and run at the edge.
Platform-as-a-service (PaaS). It is a model in which developers rent all the tools needed to develop and deploy their applications from a cloud provider. This includes middleware and operating systems. PaaS apps aren’t as scalable as serverless ones. PaaS apps don’t run on the edge. They often experience noticeable startup delays, which is not present in serverless application.
Infrastructure-as-a-service (IaaS). Cloud vendors that host infrastructure on behalf their customers is known as IaaS. While IaaS providers may offer serverless functionality on their behalf, these terms are not synonymous.
What is next for serverless technology?
As serverless computing continous to evolve, more and more providers are coming up with ways to address its shortcomings. Cold starts are one of these drawbacks.
To save energy and prevent over-provisioning, providers shut down serverless functions that have not been called for a while. If an application calls the function, the provider of serverless will need to restart it and host it again. This startup time causes significant latency and is called a ‘cold start’.
After the function has been up and running, it will be much faster served on subsequent requests (warm start). But if the function does not get requested for a while the function will again become dormant. This will mean that the next user who requests that function will get a cold-start. Cold starts were considered an essential trade-off for serverless functions up until very recently.
Some providers address this problem by spinning up serverless functions in advance, during the TLS handshake. Since workers functions spin up at the edge in a very short amount of time, even shorter than the time required to complete the handshake, the result is an FaaS platform with zero cold starts.
Serverless architecture will become more common as more and more of its drawbacks will be addressed and the popularity of edge computing increases. We’re working in the project DISTINGO on bringing serverless computing to the network edge in the context of logistics.
Cloudflare article: https://www.cloudflare.com/learning/serverless/what-is-serverless/