Executive's guide to serverless architecture

If you're wondering whether serverless computing functions are right for your business needs, learn about this cost saving, code-simplifying service.
Written by Brandon Vigliarolo, Contributor

From online word processing to scaling virtual servers, cloud computing has become an integral part of the business world.

If your business is looking for cloud computing services and needs more power than online document editing but not an always-on, and frequently expensive, cloud server, you may find a happy medium in serverless architecture.

Also called serverless computing, serverless cloud services offer the ability for businesses to run self-contained snippets of code in the cloud without paying for a virtual server. The cost saving and performance boosts can be immense -- but only if it's a good fit for your computing needs.

Executive summary (TL;DR)

What is serverless architecture? Serverless architecture is a pay-per-use approach to running small chunks of self-contained code in the cloud. Instead of paying for an always-on virtual server, users only pay for compute time. It eliminates the need to pay for computing overhead and shifts the burden of hardware management onto the cloud provider.

How does serverless architecture work? Serverless code snippets, commonly called functions, are stored and run on servers managed by cloud providers. Functions are dormant until a particular input condition is met, at which time they spin up, execute, and then shut down again.

What are the potential benefits of serverless architecture? Serverless architecture can save businesses money by eliminating infrastructure and cloud computing costs, is infinitely scalable, can reduce latency, and simplifies development, among other benefits.

Who is serverless architecture designed for? Serverless computing is incredibly flexible, making it useful for a wide range of applications. Websites, web apps, analytics, data filtering, and automating routine computing tasks are just some of the ways to use serverless computing.

What are the biggest serverless architecture platforms? AWS Lambda was the first serverless platform and continues to be the largest, but there are other options available from Google, IBM, Microsoft, and Oracle.

How does a business get started with serverless architecture? If you think serverless architecture is a good fit for your cloud computing needs, you can sign up for a serverless computing platform online, and in most cases get a good deal of use for free before having to invest money in it.

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

What is serverless architecture?

When you first hear the term 'serverless architecture' or 'serverless computing,' it's understandable that there would be a bit of confusion -- especially about the lack of a server. Surely, if code is running in the cloud, there's a server involved at some point, right?

The fact is that, yes, servers are involved no matter which serverless platform an organization uses. The term serverless architecture is more of a description for customers that informs them what they're getting: The ability to run code without having to pay the price for an always-on server.

In fact, all of the maintenance cost for hardware, electricity, support, and other incidental tech expenses is handled by the serverless computing provider. The only thing that customers have to pay for is the time spent using server resources, which are shared among various other serverless functions all running on the same machine.

In short, serverless computing is a cloud service that allows organizations to run snippets of on-demand code without having to pay for the hardware necessary to host and run that code.

Additional resources

How does serverless architecture work?

The most important thing to know about the workings of serverless architecture is the code snippet. Serverless code snippets, also known as functions, are what an organization writes to be executed on a serverless computing platform.

Functions are commonly written in Python, Java, Node.js, Go, PowerShell, C#, PHP, and Ruby, with many serverless platforms adding support for additional languages as time goes on.

Regardless of what language they're written in, serverless functions all have to meet one condition: They can't have outside dependencies or need additional code to operate. Functions are completely self-contained, which allows them to be activated quickly, execute their task, and shut down without the need to pull from outside sources or additional libraries.

Functions are built to be triggered by a particular condition: A photo uploaded to a website, an API request needs to be authenticated, an e-commerce order is placed, and so on. The use cases for serverless functions are nearly unlimited, provided the code is self-contained and can be activated by an API call.

When a serverless function is activated, it performs its task, shuts down upon completion, and awaits its trigger condition to run again. While that function sits dormant, its owner isn't charged a thing.

Additional resources

What are the potential benefits of serverless architecture?

Cost is one of the biggest benefits to serverless architecture -- who wants to pay for unused computing resources? This fact alone is often enough to create a use case for serverless computing.

One important thing to know about paying for serverless architecture is that it can be confusing, particularly in reference to the measurement of time that is commonly used in pricing schemes: GB-seconds.

GB-seconds aren't actually a function of gigabytes or seconds. The value of a GB-second is derived from multiplying the maximum memory size of a serverless function (in GB) by the time in seconds the function runs. Understanding this, and knowing how to do the work to figure out the GB-second value of the function you need to run, is a key part of understanding the potential costs.

In many cases, however, serverless computing can be completely free if you don't go over a certain GB-second limit. All of the major serverless computing platforms offer a free tier that, at minimum, offers 1,000,000 computations per month (or 400,000 GB-seconds), with Google being the only one to offer more (2,000,000 computations/month).

Serverless computing also saves money on infrastructure: There's no hardware to purchase or maintain, less space is needed in the server room, electricity use is reduced, and more. The cost savings are hard to calculate exactly -- there are potential savings everywhere you look.

Scalability is another advantage of serverless architecture: As long as you have the budget to pay for it, your serverless functions can run once or 10 million times per billing cycle. The computing resources needed to execute a serverless function are minimal, and the data centers where serverless computing hardware is located are distributed around the world, so your functions will always be able to scale up as needed.

Speaking of distribution, serverless functions can greatly reduce latency for users whose action triggers their activation. Instead of data having to travel to a central location, serverless functions can be activated at the nearest data center, reducing travel time and latency. On top of that, by distributing the location users are reaching out to, there's a lot less potential for congestion, which can also increase latency.

Serverless functions can also result in much less code complexity. As mentioned above, serverless functions have to be self-contained, which means they have to be able to run on any hardware, anywhere, and without needing to reach out to external sources for supplemental code. All of those restrictions mean serverless functions have to be built simply, making the barrier to building them significantly lower for developers.

Additional resources

Who is serverless architecture designed for?

It's difficult to think of a business cloud computing use case that couldn't be translated into a serverless function -- take AWS Lambda's case study page as an example. The organizations included in the case studies had various reasons for using Lambda functions.

The flexibility of serverless computing means it can be used in a wide variety of applications, such as:

  • Website scaling: By building a website or a web app around serverless functions, a website can be stood up faster and scale to a larger user base without interruption.

  • Image processing: Images filtered through a serverless function can be categorized and sorted using machine learning, resized, reformatted, and more.

  • Internet of Things (IoT) sensor input: Data received from IoT sensors and devices can be filtered, logged, and responded to automatically.

  • Extract, transform, and load tasks: ETL software can get expensive, but its work can largely be handled by serverless functions.

  • Event streaming and logging: One of the toughest things about troubleshooting IT systems is tracking down specific events that cause problems. Functions can be built to log events and return alerts when specific conditions are met.

  • Build multilingual applications: Instead of having to pick one particular programming language, serverless functions can be strung together to execute tasks in multiple languages, allowing developers to stick to what they know best.

  • Automate scheduled computing tasks: Tasks that need to be performed at certain intervals, or at particular times, can be automated using serverless functions.

  • Moving data: If data is uploaded in one particular application, but needs to be transferred to another for whatever reason, a serverless function can take care of it.

  • Big data processing: Trying to filter out particular types of data can be tough, but serverless functions can take care of it by being built to trigger when certain inputs are detected.

This list of use cases isn't exhaustive. If you're not sure your serverless needs fall into one of these categories, it's best to reach out to the serverless provider to see what they can offer.

Additional resources

What are the biggest serverless architecture platforms?

If you're considering going serverless, there are a number of vendors to consider.

First and foremost, there's AWS Lambda. Amazon's offering is the oldest, the largest, and the most popular serverless computing platform. It can take care of most serverless computing needs, and for customers of Amazon's other AWS offerings, it's a no-brainer to choose Lambda as a serverless provider.

Lambda also features tight integration with Amazon's other compute and machine learning services, allowing its serverless function to be triggered by other AWS services along with HTTP and API triggers. There's also a robust library of tutorials to make adjusting to the serverless world of AWS Lambda easier.

Not to be outdone, Google has built its own serverless computing platform called Google Cloud Functions, which works similarly to AWS Lambda. As an added bonus, Google Cloud Functions offers twice the number of free computations per billing cycle as AWS and its other competitors, giving 2,000,000 to everyone else's 1,000,000. Its GB-seconds limit is the same, however, which means that extra million may not matter that much.

Google Cloud Functions integrates tightly with its other cloud services, making it a great fit for those already invested in Google's cloud platform.

Microsoft Azure Serverless Computing offers similar services, as does IBM. The only serverless computing platform that differs from what's offered by Amazon, Google, Microsoft, and IBM is Oracle, whose Fn Project throws a wrench into what's typically thought of as serverless computing.

The Fn Project is open source and container native, allowing it to be run on any server, anywhere. It's not a typical serverless architecture platform, as it requires access to either a local server or a cloud-based one, but it does have the potential to eliminate vendor lock-in associated with the other platforms.

If you want to build your own serverless computing platform from scratch, the Fn Project may be your best option, provided you're ready to take on a lot of added responsibility without offloading any of the complications traditionally eliminated by other function-as-a-service platforms.

Additional resources

How does a business get started with serverless architecture?

One of the best things about serverless computing is how low the bar to entry is. You don't need to do anything aside from signing up for an account by visiting the get started link for AWS Lambda, Google Cloud Functions, Azure Serverless Computing, or IBM Cloud Functions. The Fn Project requires some manual work, which you can find out more about on its GitHub getting-started page.

Once you're signed up, it's easy to get started, provided you know what you want to build and how to build it. Be sure to take advantage of the tutorials offered by all the major vendors -- those guides will go a long way to getting you settled and familiar with the intricacies of each platform.

Additional resources

Editorial standards