LFCA: Learn Serverless Computing, Benefits and Pitfalls – Part 15

Serverless technology has generated a lot of hype in the tech community evoking a lot of curiosity and receiving some backlash to a little extent. It’s a technology that began with the launch of AWS Lamba in 2014, which was soon followed by Azure Functions later in 2016.

Google later followed suit with the release of Google Cloud functions in July 2018. So, what is serverless technology? To best answer this question, let’s take our minds back to traditional server-based computing.

In the traditional IT model, you were in charge of basically everything. As a business owner, you would have to budget for servers and other networking equipment such as routers and switches, and racks for mourning the servers.

You’d also have to worry about getting a pristine and secure data center and ensure it can sufficiently provide cooling and redundant power and internet service. Once set up, you would then have to install the operating system, and later deploy your applications. Additionally, you would be required to set up monitoring systems and implement security features such as firewalls and intrusion prevention, and detection systems.

As you might have guessed, this is resource-intensive, costly, and draining.

Then cloud computing broke into the tech world, completely revolutionizing the way we deploy and manage servers and applications. It heralded a new era where developers would readily whip up cloud servers and databases in no time and start working on their applications. No worries about issues associated with traditional IT computing such as downtime, expensive equipment, and renting datacenters.

While cloud computing brought with it the convenience and economies of scale in deploying IT resources, some companies would over-purchase units of server space and resources such as RAM and CPU in anticipation of a spike in network traffic or activity which might overwhelm applications.

Whilst it’s a prudent move, the unintended outcome is the underutilization of server resources which often go to waste. Even with autoscaling, still, an unforeseen and sudden spike could prove costly. Also, you’d still need to carry out other tasks such as setting up load balancers which are also likely to increase operational costs.

It’s apparent that despite making a shift to the cloud, some bottlenecks still linger and have the potential of scaling up costs and cause resource wastage. And this is where Serverless computing comes in.

What is Serverless Computing

Serverless computing is a cloud model that provides backend services to users on a pay-as-you-go basis. In simple terms, the cloud provider allocates compute resources and charges only for the time that the applications are running. This is the equivalent of switching from a monthly plan for cable payment to paying only for when you are watching your TV shows.

The term ‘Serverless’ might be a little bit misleading. Are there servers involved? Sure, however, in this case, the servers and underlying infrastructure are purely handled and maintained by the cloud provider. As such, you need not worry about them. As a developer, your focus is purely on developing your applications and ensure they are working to your satisfaction.

In doing so, serverless computing takes away the headache of managing servers and saves you precious time to work on your applications.

Backend Services Provided by Serverless Computing

A perfect example of serverless backend service is Function-as-a-Service (FaaS) platform. FaaS is a cloud computing model that enables developers to develop, execute, and manage code in response to events without the complexity of building and managing an underlying infrastructure usually associated with the deployment of microservices.

Faas is a subcategory of Serverless computing with subtle differences. Serverless computing encompasses a wide range of services including compute, database, storage, and API to mention a few. FaaS is solely focused on an event-driven computing model where applications are executed on-demand, that is, in response to a request.

Examples of FaaS computing models include:

  • AWS Lambda by AWS
  • Azure functions by Microsoft
  • Cloud Functions by Google
  • Cloudflare Workers by Cloudflare

In summary, we have seen that with FaaS, you only pay for the time that your application is running and the cloud provider pretty much does everything for you including handling the underlying infrastructure. Managing servers is the least of your worries.

Benefits of Serverless Computing

By now, you have a good idea of some of the merits that serverless computing brings to the table. Let’s delve deeper into the advantages of embracing the technology.

1. No Server Management

This is perhaps one of the greatest advantages of adopting the serverless computing model. Although the term ‘serverless’ might be misconstrued to imply that there are no servers involved, the fact is, applications still run on servers. The crux of the matter is server management is entirely the business of the cloud vendor, and this accords you more time to work on your applications.

2. Easy and Efficient Scaling

Serverless infrastructure provides automatic scaling of applications in response to a surge in usage, demand, or growth of user base. If the application is running on multiple instances, the servers will start and stop when required. In a traditional cloud computing setup, a spike in traffic or activity can easily overload server resources leading to inconsistencies with the application being executed.

3. Built-in Availability

As a developer, you do not need to build any special infrastructure to make your applications highly available. Serverless computing provides you with built-in high availability to ensure that your applications are up and running when required to do so.

4. Reduced Operation Costs

Serverless computing allocates resources on a pay-as-you-use basis. Your application will only require backend functions when the code executes and will scale automatically based on the amount of workload.

This provides economies of scale as you are only billed for the time that the applications are running. In the traditional server model, you have to pay for server space, databases amongst other resources regardless of whether the application is running or idle.

5. Faster Deployments of Applications

The serverless architecture eliminates the need for backend configuration and manually uploading code to servers like in the traditional setup. It’s easy for developers to upload small stacks of code in an efficient manner and launch a great product.

The ease of deployment also allows developers to easily patch and update certain features of code without altering the entire application.

Pitfalls of Serverless Computing

Are there any drawbacks associated with the serverless model? Let’s find out.

1. Security

Poorly configured applications pose one of the greatest risks associated with serverless computing. If you opt for AWS, for instance, it’s prudent to configure different permissions for your application which will, in turn, determine how they will interact with other services within AWS. Where permissions are vague, a function or a service can have more permissions than is required, leaving ample room for security breaches.

2. Vendor Lock-in

Opting for a serverless model may present challenges when migrating to another vendor. This is mainly because each vendor has its own features and workflows that slightly vary from the rest.

3. Difficulty in Testing and Debugging Applications

Another challenge posed by the serverless model is the difficulty in reproducing a serverless environment for testing and monitoring the performance of code before going live. This is primarily because developers lack accessibility to backend services which are a preserve of the Cloud provider.

4. Difficulty in Monitoring Serverless Applications

Monitoring serverless applications is a complex undertaking for the same reasons that debugging and testing is an uphill task. This has been compounded by the unavailability of tools with integration to backend services such as AWS Lamba.

Conclusion

Serverless computing continues to gain traction and uptake among companies and developers for 3 key reasons. One is affordability which implies reduced operational costs. Secondly, serverless computing facilitates automatic and fast scaling, and finally, developers don’t have to worry about the underlying infrastructure which is handled by the vendor.

Meanwhile, cloud providers are working round the clock to address some of the pitfalls associated with serverless computing such as difficulty in debugging and monitoring applications.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.