by Eric Goebelbecker
Serverless architecture has gained a lot of attention over the past few years. It’s a mainstream option for cloud applications that’s been available for several years. Amazon released AWS Lambda to the public in 2014. Soon after, they made Lambdas the primary method for writing Alexa “skills.” Microsoft followed with Azure Functions less than two years later, and Google released their Cloud Functions in 2017.
These are only the “big four” vendors; there are many others. Demand for serverless has increased steadily over the past five years, and vendors have rushed to meet it. What is serverless computing? What has driven its popularity? Is it the right choice for your IT infrastructure? Can it save you money? How does it affect testing? Will it improve your system’s performance and uptime?
Let’s take a look at what serverless computing means. We’ll discuss how it can improve your infrastructure, how it affects your testing environments and can lower your IT costs.
What Is Serverless Architecture?
Serverless Architecture has servers, but you don’t have to maintain them. Your cloud provider manages systems that run your applications for you.
So, serverless simplifies deploying and maintaining applications to the cloud. Your development teams develop discrete pieces of business logic that run in the cloud platform. These applications are often called “functions,” giving serverless its other common name “functions as a service” or FaaS. Instead of maintaining servers, you deploy these functions to a cloud platform.
MartinFowler.com provides a couple of examples of serverless architectures in a post from last year. Both cases share one common attribute. They break down the interaction with the client application into functions that run on a serverless platform. The pet store example replaces a monolithic server with microservices. The services respond to client requests and scale on demand. The advertising application uses serverless functions to respond to clicks. The system models user clicks as asynchronous events. It also scales up based on traffic, like the pet store. As you can see from both examples, serverless and microservice architecture are well-suited to each other.
We’ve mentioned the major platforms: AWS Lambda, Azure Functions, and Google Cloud Functions. There are many others, including webtask.io, IBMBlueMix, and hook.io.
When you build an application around serverless, you tend to rely on the cloud platform’s managed services. This makes sense. Why set aside application servers but maintain them for a database, storage, or other infrastructure? But, this direction has consequences.
If you’re migrating applications from an on-premises platform, there may be compatibility issues. You’re limited to the capabilities of the managed services. And, of course, you’re handing a large piece of your application to a third-party vendor.
What Does Serverless Mean for Testing?
Testing serverless is a bit of a mixed bag. Unit and local testing serverless applications should be simple and straightforward. A well-designed serverless application consists of isolated functions with discrete inputs and outputs. Designing and implementing tests for each piece, hopefully as you create them, is easy.
But reliance on managed services can complicate integration testing. Should your tests use the external systems or is cost a prohibitive factor? Running extra instances of managed services can be expensive. Is testing against “stubbed” databases and storage enough?
Even if you decide to go “all-in” and test against cloud services, it isn’t always easy. You have to make sure that your tests don’t interfere with production resources. So, you need to set up your CI/CD system to deploy to different resources. Maybe you need a separate cloud account or a virtual private cloud.
But, this doesn’t mean that serverless is a net loss for testing. Orchestrating test environments requires care and planning. But, you can rest assured that Amazon and Microsoft are better at testing their managed services than you are. You can focus your testing efforts on your application’s behavior instead.
What Does Serverless Mean for IT?
Serverless architecture means deploying code to someone else’s servers. For some organizations, that’s already a problem. Serverless has its drawbacks, and there’s no such thing as a free lunch, but it’s close. It’s at least as good as getting a free drink or extra fries.
You don’t have to maintain backend servers. You don’t need to dedicate resources to managing networking, operating system patches, filesystems, and the other overhead associated with them. Plus, as mentioned earlier, moving to managed services tends to come along with serverless. So, maintaining those servers goes away too.
But maintaining server infrastructure isn’t limited to keeping them running and up-to-date, is it? You need scalability, too. Your application probably experiences different loads depending on the time of day, week, or year. How do you plan for that?
Do you size your system for the highest expect load and pay for servers that sit unused? Whether you’re running your system on-premises or in the cloud, unused system capacity is wasted money. But, if you can’t manage capacity in real-time, you need to either size for the worst-case scenario or risk not being able to serve client requests.
Do you take on the expense of managing an orchestration system that can spin servers up and down based on load? Containers and management infrastructure such as Kubernetes can scale your app based on demand. This removes the need for idle systems that you run in anticipation of demand. But, this capability doesn’t come for free. You need to have the expertise to design and implement a dynamic infrastructure.
Serverless takes care of scaling your application infrastructure for you. The platform creates and destroys instances of your code as they are needed. So, if your applications need to accommodate a heavy load for a brief period, it will create the resources required and destroy them when it doesn’t need them anymore. You pay for exactly what you need, only when you need it, and you don’t have to build and run the infrastructure.
Serverless Simplifies Managing Your Infrastructure
With serverless architecture, you focus your efforts on your application. You deploy your business logic as one or more functional pieces of behavior, and the platform takes care of running and scaling it based on user demand. You can save both money and time by offloading the responsibility of running and maintaining infrastructure to the cloud platform. But, serverless is a significant shift. You’ll need to adjust how you manage your use of cloud services. Your test environments will need to either move to the cloud or at least embrace it.
Serverless has been a hot topic for a long time, and for good reasons. You should take a close look at it and see if it can help you build better applications.
Eric has worked in the financial markets in New York City for 25 years, developing infrastructure for market data and financial information exchange (FIX) protocol networks. He loves to talk about what makes teams effective (or not so effective!)
01 JULY, 2020 by Diego Gavilanes Ever since the dawn of time, test environments have been left for the end, which is a headache for the testing team. They might be ready to start testing but can’t because there’s no test environment. And often, the department in...
29 JUNE, 2020 by Carlos Schults In today’s post, we’ll discuss data literacy and its relevance in the context of GDPR. We start by defining data literacy and giving a brief overview of GDPR. Then we proceed to explain some of the challenges organizations might face...
23 June, 2020 by Arnab Roy Chowdhury In this digital era, online businesses have become mainstream. Consequently, online commerce has flourished—and led to loads and loads of data! Businesses need to build data centers to store information. Not only that, but if you...
08 JUNE, 2020 by Eric Boersma Every company needs a disaster recovery plan. This is just a simple fact of life. Your company needs to know how to recover when something breaks or you can’t get access to something you need. In larger, more advanced tech companies,...
25 May, 2020 by Daniel Longest Zombie and ghost assets sound exciting, like a late-night movie you’d watch around Halloween. While in reality they may not be that exciting, they’re scary if you don’t understand and prevent them. The good news is the steps you need to...
05 May, 2020 by Eric Boersma Taking on Site Reliability Engineering (SRE) is not an easy task. It doesn’t matter where you’re coming from. Some organizations have done a little DevOps and are trying to break into SRE. Others haven’t even taken that step, and figure...