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!)
17 JANUARY, 2020 by Sylvia Fronczak Site reliability engineering (SRE) uses techniques and approaches from software engineering to tackle reliability problems with a team’s operations and a site’s infrastructure. Knowing the history of SRE and understanding which...
25 JANUARY, 2020 by Michiel Mulders With the cost of data breaches increasing every year, there’s a huge need for higher security standards. According to IBM’s 2019 security report, the average total cost of a data breach has risen to $3.92 million per breach. It’s no...
08 DECEMBER, 2019 by Arnab Roy Chowdhury In the last few years, people have started to rely less on manual work and more on automation. Internet banking and online shopping portals are some examples of this growing trend of digitalization. Instead of going to the bank...
12 DECEMBER, 2019 by Carlos Schults The software development process today is very different from what it used to be 15, 20, or even more years ago. One of the most dramatic of such differences is undoubtedly the number and frequency of releases. Agile practices have...
26 November, 2019 by Carlos Schults Your Essential TEM Checklist “Test Environment Management Checklist.” Yep, that sounds like a mouthful, but don’t let that discourage you. The idea here is quite simple—adopting a checklist to evaluate the soundness of your test...
18 NOVEMBER, 2019 by Carlos Schults Test data management is vital for achieving a healthy test automation strategy, yet many professionals are still not familiar with the term. They don’t know what the concept means, nor why it’s so important. But why would that be a...