Serverless computing pros and cons: 5 benefits and 3 drawbacks

Serverless computing can be a great fit for certain applications, but there are drawbacks to consider before jumping feet first into the serverless deep end.

hybridcloud.jpg
Image: a-image, Getty Images/iStockphoto

If you've been exposed to the world of cloud computing, you've likely heard of a service that's growing in popularity: Serverless computing.

This form of computing-as-a-service has its advantages, especially for those who really want hands-off cloud computing, but it isn't for everyone. If you've been considering ditching an always-on cloud computer in favor of on-demand serverless services, weigh these pros and cons to help figure out if serverless computing is right for you.

SEE: Prepare for serverless computing (ZDNet special report) | Download the report as a PDF (TechRepublic)

5 benefits of serverless computing

1. No infrastructure to maintain

Debate continues as to whether the cloud is truly "someone else's computer," but that debate doesn't really have a place in serverless computing.

Serverless computer services, which are small snippets of code meant to execute a single function, are executed on pre-existing servers that run functions for countless other customers as well. Since you're literally using someone else's computer to execute your serverless functions, there's no infrastructure to maintain—even virtually—with serverless computing.

2. No costs when functions aren't running

As Hacker Noon points out, the costs associated with serverless computing are minimal compared to other cloud services. Access authorization, presence detection, security, image processing, and other costs associated with operating a server, whether physical or virtual, are eliminated under a serverless model.

To get an idea of the costs associated with serverless computing, look at the AWS Lambda pricing table. Lambda functions are one type of serverless computing offered by AWS, and it's incredibly cost-effective for those needing to perform analytics, process data, manage web apps, or perform other services handled by Lambda.

Those who perform less than one million and 400,000 GB-seconds of compute time per month don't have to pay a single thing. Beyond that, it's only $0.20 per additional one million requests and $0.00001667 for each additional GB-second of processing power (this is an estimate only and can vary based on the amount of memory used by a function). Pricing is the same in all regions, except Hong Kong (see the AWS Lambda pricing page for details).

In short, serverless functions can be dirt cheap, and if they aren't being spun up for use, you aren't paying anything.

SEE: AWS Lambda: A guide to the serverless computing framework (free PDF) (TechRepublic)

3. Infinitely scalable

Looking to Google's Cloud Functions, one of the top selling points is its automatic scaling capabilities. Google shares that capability with AWS and Azure—in fact, any serverless platform worth investing in is designed to scale based on need.

That's another advantage to serverless computing—there's never a need to partition a new cloud server or purchase additional computing power for an existing instance. All of that is handled by the serverless computing platform, leaving you with no complication outside of a slightly larger bill for additional computing time.

4. Reduced latency

Cloudflare points out that using serverless functions can greatly reduce the latency experienced by end users. Serverless functions don't operate from an origin server, so there's no single location that an end user's traffic has to be directed to.

Instead, any of a cloud provider's data centers can be used to run a serverless function. That means whichever server a user is closest to will be the one that executes the function, significantly reducing response time.

5. Reduced software complexity

When building code to run directly on a computer, a lot of things must be taken into account: The operating system, the hardware resources needed to perform certain tasks, dependencies, and other factors are all part of building a functional app.

Serverless computing functions don't need to take any of that into account—the code just has to be supported by the cloud platform being used. On top of being easier to build, serverless functions require a lot less coding knowledge to build, which opens up development to those at lower skill levels.

SEE: Executive's guide to serverless computing (ZDNet)

3 drawbacks to serverless computing

1. Security issues

A server that runs serverless functions runs them for myriad customers, which opens up a lot of security concerns. TechRepublic sister site ZDNet lists 10 potential security risks associated with serverless computing, which include:

  • Function event data injection, which is an SQL injection-style attack on a server running serverless functions;
  • Insecure serverless deployment configuration, which accounts for any number of mistakes on the administrative end that leave serverless computing servers open to man-in-the-middle attacks;
  • Inadequate monitoring and logging of functions, which can tip administrators off to attackers performing reconnaissance to test the potential for attack;
  • Insecure third-party dependencies—serverless functions that call on third-party dependencies can put data at risk if those dependencies contain malicious code; and
  • DDoS attacks on serverless platforms can overload them and take down functionality for multiple customers at the same time.

2. Vendor lock-in

Building serverless functions on one platform can mean that migrating to another is difficult. Code might need to be re-written, APIs that exist on one platform may not exist on another, and additional manpower (and money) has to be committed to move from, say, AWS to Azure or Google Cloud.

If you're going to invest in a serverless platform, be sure the vendor you're considering has everything you need because becoming unhappy with your serverless computing provider a few months or years into your service can be a major problem.

3. Debugging is more difficult

Every time a serverless instance spins up it creates a new version of itself, and that means it's difficult to collect data necessary to debug and fix a serverless function.

Third-party tools that log serverless function events exist, but without adding an additional tool, debugging a serverless function can be cumbersome. AWS, for example, requires step-through debugging (going line-by-line) to find out what's going wrong.

Debugging serverless functions is possible, but it's not a simple task, and it can eat up lots of time and resources.

SEE: Pros and cons of using serverless architecture for your application deployments (ZDNet)

Is serverless computing ideal for you?

Whether you want to consider serverless computing boils down less to its pros and cons and more to your particular needs.

If your computing needs tend toward granular, short-running tasks that have a single purpose, then serverless computing could be a great time and money-saving investment. If you need open-ended systems that do a lot of in-depth analysis or perform long-running computations, it's probably not for you.

To find out more about serverless computing options, check out the AWS, Google Cloud, IBM Cloud Functions, and Microsoft Azure's pages.

Also see