Get ready for the next big disruption in the cloud: serverless computing
In the process of sending more than 1.5 billion messages a day and interacting with more than 1 billion consumers a month, Braze Inc. uses a lot of cloud infrastructure. But its business is unpredictable, so demand for computing resources can fluctuate dramatically depending on the volume of data it must transform to support its customers’ personalized messaging needs.
“At one point we may have 100 servers running, and at another we may have 1,000,” said Sal Poliandro III, director of DevOps and security at the customer engagement company. Braze used to scale its cloud infrastructure based upon a set of metrics that ultimately supported what amounted to an educated best guess. Then it discovered Lambda, Amazon’s serverless computing platform.
Now, the process is entirely automated. An algorithm determines how much capacity the company needs and then kicks off a function that reaches out to its infrastructure partners and triggers scaling instantly. “We used to scale based on peak loads,” Poliandro said. “With serverless, we don’t have to worry about that.” For a typical development team, he estimates the process is at least 10 times faster than provisioning servers manually.
Braze is one of the growing number of companies that are catching on to what is arguably the hottest new trend in the cloud — and perhaps in information technology at large. Serverless computing, including its subcategory called function-as-a-service, has captured the imagination of developers and chief information officers alike by setting them free from the drudgery of provisioning infrastructure while delivering often dramatic cost savings.
Some people believe it’s the way most software ultimately will be built. “This underlying technology is going to create an opportunity to redefine the complete application stack, and the way software is written, the way the applications are built,” said Navin Chaddha, managing partner at the venture capital firm Mayfield Fund LLC.
The enthusiasts might be getting a bit ahead of themselves. After all, serverless computing is barely out of the incubation stage. But excitement is building as early adopters report encouraging results.
An analysis of cloud usage by 1,500 organizations by Cloudability Inc. found that use of serverless platforms grew more than sevenfold in the fourth quarter of 2017, though off a small base. RightScale Inc. reported that serverless was the fastest-growing extended cloud service in 2017 among the nearly 1,000 information technology professionals it surveyed, with the adoption rate growing from 12 to 21 percent.
And it’s not just startups and websites. Tim Wagner, general manager of AWS Lambda and related serverless services, said large enterprises such as CapitalOne, Hearst Corp. and the Financial Industry Regulatory Authority are the fastest-growing users of Lambda.
Indeed, some companies are already pushing serverless much further into mainstream and even leading-edge computing. The mortgage finance firm Federal National Mortgage Association, known as Fannie Mae, for instance, is moving its risk analysis simulations from its own servers to Lambda, creating what it said is the finance industry’s first serverless high-performance computing platform.
Software developers who haven’t already gotten on board are scrambling to catch up, and the biggest tech players, eyeing tech’s next key battleground, are jockeying for their attention. Serverless will be the topic of no fewer than 19 sessions, for instance, at the Google Cloud Next conference in San Francisco July 24-26. And it’s the headliner of an entire series of Serverlessconf conferences, including one in San Francisco July 20 through Aug. 1.
“Serverless computation is going to fundamentally change not only the economics of what is back-end computing, but it’s going to be the core of the future of distributed computing,” Microsoft Chief Executive Satya Nadella said at the company’s Build conference last year.
No muss, no fuss
Put simply, serverless technology does away with the need to set up servers and software each time a program is run. Instead, functions execute automatically based upon an event, whether triggered by a human or by a program.
The term “serverless” is actually a misnomer, since servers are still needed to execute functions. But the process happens in milliseconds compared with the hours or days it can take to set up a virtual server, or a computer simulated in software. As a result, serverless applications can scale nearly infinitely at very low cost because customers pay only when the function is used, rather than for idle server time.
In contrast, the process for deploying conventional integrated applications requires allocating infrastructure such as central processing units, memory and storage, along with a suite of platform software. Those resources still must remain available even if the application is only used occasionally. Overprovisioning drives up costs, wastes capacity and contributes to “server sprawl,” a situation in which information technology organizations pay for little-used or forgotten cloud instances.
In a serverless scenario, developers build applications as collections of small pieces of code – or functions — that are assembled on the fly in an orchestrated fashion. That means no waste, low overhead and rapidly scalability to match capacity needs.
Mobile computing has driven much of the recent interest in this area because many mobile apps lend themselves well to a serverless design. A smartphone user looking up a local weather forecast or directions to the football stadium isn’t interested in anything else. Such queries can be encapsulated and stored in the cloud to be called when necessary. The program simply passes a parameter, such as the person’s location and destination, to the server, which returns a single, targeted result.
Serverless relieves the headache that companies such as Braze used to experience when planning for unpredictable usage scenarios. That makes it a good model for news organizations that see traffic spikes during important events or sports teams whose fan activity surges when the team makes the playoffs. Many of these organizations would otherwise simply overallocate resources to protect themselves, paying for resources that go unused.
Decade in the making
Serverless concepts aren’t new. Google’s App Engine had elements of metered billing in 2008. But the concept began to gain popularity with Amazon’s launch of Lambda in 2014. Other cloud providers have followed suit, including Google Inc. with Cloud Functions, Microsoft Corp. with Azure Functions and IBM Corp. with OpenWhisk. A large ecosystem of commercial and open-source products and services has sprouted up in the meantime, including options for on-premises deployment.
The distributed nature of serverless applications is one of its most intriguing features. Serverless code doesn’t necessarily run faster than conventional code, but it can be distributed across a network for parallel execution. Google’s BigQuery analytics data warehouse, for example, splits queries into pieces and processes them wherever servers are available.
That means results can be returned at orders of magnitude faster speeds than those processed with single-thread engines. Distributed engines can also be much more flexible and scalable in the way they use resources because functions can be fired off anywhere. Horizontal scaling is automatic, elastic and managed by the provider.
“The ultimate goal of computing is like the calculator: I want to be able to have a very simple interface, and the computer should give me an answer back,” Kelsey Hightower, a staff developer advocate at Google Cloud, told theCUBE, SiliconANGLE’s livestreaming studio, at the KubeCon conference in Copenhagen in May. “We’re never going to stop until the experience becomes, ‘Here’s my app, run it for me.'”
So why hasn’t this technology taken the world by storm yet? Well, for one thing, it’s still early. “Most customers are using it for very specific solutions, such as event processing and data intake,” said Lee Atchison, senior director of strategic architecture at New Relic Inc. “The massive rollout hasn’t really started yet.”
Another reason is that the structural limitations of the serverless model currently confine it to a limited set of applications. “I think few companies will go all-in on serverless; your general IT shop will have a mix,” said Rich Sharples, senior director of product management at Red Hat Inc. Serverless is a great way to perform simple tasks quickly, but it lacks some key control features that monolithic or microservices-based platforms provide, he said.
Craig Lowery, a research director in the technology and service provider group at Gartner Inc., is more optimistic. “People don’t understand it, so they delegate it to a niche,” he said. Gartner studied five companies as they moved up the serverless learning curve and found that all became converts once they discarded traditional norms for developing software. “Once they kicked those old expectations, they were able to realize the benefits,” he said.
Indeed, companies such as AWS — whose CEO Andy Jassy said last year that if Amazon were being built today, it would be on a serverless platform — say they’ve been surprised at the rapid uptake of the technology, even among large enterprises.
“We have a lot of enterprise customers that we thought would not be the first to adopt Lambda,” Mark Ryland, director of AWS’ Office of the Chief Information Security Officer, told SiliconANGLE at the company’s AWS Summit in New York this past week. “But since they’re doing significant application rework, they say, ‘Why should I go to containers? I can construct an application that just functions.'”
Stateless and event-driven
Two distinctive features of serverless computing are both its greatest appeal and its biggest impediment to more widespread adoption.
The first is that serverless functions are stateless, meaning they have no context for an interaction. They don’t store history and so handle each request using only the information provided with it. “It’s like a blank slate each time, but it’s highly efficient because you’re not managing a lot of thick application logic,” said James Kobielus, an analyst at Wikibon, a sister company of SiliconANGLE.
The other distinctive characteristic is that serverless functions are event-driven, meaning that they respond to actions generated by a user or a program. Examples of events might include a request for the current temperature in Minneapolis (below), a search engine query or an update to a database record.
Event-driven applications are highly efficient because they don’t consume resources when they aren’t being used. They’re simple to program and easy to scale. “You can set it up so if one event comes in, then one function runs. If a million comes in, you fire off a million,” Lowery said. However, not every application can be distilled down to a sequence of stateless events.
Combined, these features make serverless computing a great platform for some things, such as checking how hot or cold it is in Minneapolis. However, it’s not so great for others, such as managing a shopping cart or churning out billing statements.
“Someone clicks on ‘buy’ and an entire set of database and runtime functions do pricing, finalize the order and send a confirmation,” Kobelius said. “All that has to happen in a strict way with states and a flow of transactions,” which makes it a poor match for serverless execution.
It’s not yet clear whether tools and extensions will emerge to make the serverless approach viable in more traditional applications. Stateless applications can be extended or retrofitted to exhibit stateful behavior, as has been done with containers, the lightweight virtual machines that abstract away differences in underlying infrastructure. Containers are also stateless, but commercial and open-source extensions have made it possible for them to be used in context-sensitive applications.
Microsoft is aiming to blur the lines between function-as-a-service and platform-as-a service to enable developers to mix and match platforms. In particular, it has emphasized what it calls “Virtual Kubelets.” Introduced in December, they enable containers to run either functions or full applications, but with the microbilling and automated infrastructure provisioning serverless offers — flexibility the company says many customers want. AWS’ Fargate, introduced in late November, also allows containers to be run without managing servers or server clusters.
“It’s really the best of serverless,” Gabe Monroy, Azure’s program management lead for containers, told theCUBE at the KubeCon + CloudNativeCon North America conference in December. “We’re doing our jobs in the infrastructure space if the infrastructure disappears.”
Wikibon’s Kobielus even thinks blockchain, the decentralized digital ledger, could compensate for the statelessness in database-intensive scenarios. “You’d be able to roll back a complete narrative about who called what across what federated fabric at any time,” he said.
All that said, serverless advocates think the sky’s the limit for the technology, especially for companies willing to move beyond a “lift and shift” mentality of trying to move old applications to a new model and embrace the new way of building and running them.
As recently as a couple of years ago, for instance, Fannie Mae ran Monte Carlo simulations to analyze risk in its mortgage portfolio. Now, it’s running what it called the first high-performance computing platform using serverless in the finance industry, often a leader in using new technologies. In one simulation of about 20 million mortgages, the system did the job more than four times faster than before.
“We don’t think that there is any inherent technical limitation that will keep any of the major workloads from being used on Lambda,” said AWS’ Gilbert, who intriguingly called Fannie Mae’s use of serverless a “supercomputer in the cloud.” As more limitations are overcome, he said, “Serverless will be the easiest, the simplest and for many customers the preferred way” of doing mainstream computing.
The serverless model has one advantage that isn’t easily distilled into return-on-investment metrics: Developers love it. A serverless architecture frees them from the tyranny of infrastructure deployment and lets them just write code.
“It enables our applications and operational engineers to think about their responsibilities in a way that’s more meaningful to them,” said Braze’s Poliandro. “They can deploy faster because they don’t have to worry about the infrastructure around it.”
But building applications on serverless platforms requires a significant change in how developers think about their task. “To go to Lambda is a substantial code rewrite,” conceded AWS’ Ryland.
Fans of serverless architecture say the limitations aren’t in the technology but in a 60-year-old tradition of building integrated applications. “It challenges some assumptions and established patterns for how software should be developed,” said Gartner’s Lowery. “Customers see a lot of value, but they’re having to learn a whole new way of programming.”
Developing for stateless, event-driven environments isn’t necessarily easier than building monolithic programs. Serverless architectures “move complexity out of the application and into the connectivity,” Atchison said. “It’s not a solution to everything. It creates its own problems as well as solves them.”
Microsoft recommends that developers become familiar with programming for event-based asynchronous patterns and learn to use functions orchestrators such as its Durable Functions programming model and Logic Apps connectors to create long-running operations and state management.
But advocates say the benefits are worth the steep learning curve. What’s needed isn’t more tools as much as a more creative approach to developing software.
“The vast majority of what most applications do can be rendered as serverless functions,” Kobielus said. Containers help by making it possible for functions to be encapsulated and delivered as services. “More and more of what we see happening in containers involves containers making serverless calls,” he said. “They’re independently scalable.”
Even though the programming metaphor is different, legacy applications can still be modified to take advantage of some serverless functionality. Discrete functions that are inherently event-driven can be encapsulated separately from the main application.
For example, “anytime data is created in a database or a file system, it’s an event,” Lowery said. “That means you can set it to do something else independent of the main program.” Doing so “creates longer utility for apps,” he said, because they can be extended through the use of application programming interfaces, or hooks into other applications.
Instead of rewriting existing application from scratch, organizations can adapt pieces to gain the benefits of serverless execution and migrate in stages. “Implement new application features as microservices, split the user interface components from the business logic and data access layers and convert and split existing microservices into serverless functions,” said Rohit Akiwatkar, technology consultant at Simform LLC, a mobility and “internet of things” services firm that has published extensively about serverless development. “Over time, the number of functions will grow, and the agility and velocity of your development team will increase.”
Best of times
Is it time for CIOs to climb on board? Lowery thinks so. “I tell CIOs that this is not going to go away, it’s not a fad,” he said. “Start getting people on your staff familiar with it.”
Simform’s Akiwatkar recommends a three-step process: Understand the best practices of working with serverless architecture, identify high-ROI applications and experiment with serverless functions on low-risk environments.
It all adds up to the best of times for developers. Between containers, microservices and now serverless computing, the past five years have introduced more innovations in how applications are built and deployed than the previous 20 years put together.
And in an economy that’s desperately short of talent, being hip to the next big thing may be the only way to attract the best people. “You have to have a plan to adopt this technology for the long term or you will not have access to the talent you need,” Lowery said. “Developers will expect it.”
For organizations that are still struggling with how to adapt to endless recent innovations such as DevOps. cloud, containers and microservices, serverless computing may appear to be yet another headache to endure. But in a business world in which every company is becoming a software company, failure to get on board this latest trend could be an existential mistake.
With reporting from Robert Hof
A message from John Furrier, co-founder of SiliconANGLE:
Your vote of support is important to us and it helps us keep the content FREE.
One-click below supports our mission to provide free, deep and relevant content.
Join the community that includes more than 15,000 #CubeAlumni experts, including Amazon.com CEO Andy Jassy, Dell Technologies founder and CEO Michael Dell, Intel CEO Pat Gelsinger and many more luminaries and experts.