What is Serverless Computing?
Serverless computing is a type of cloud computing in which you only have to pay for the execution time you use, rather than paying for a set amount of usage even if it is underutilized.
Serverless frameworks are making cloud deployment even easier by removing the need to design your own server-side systems. Integrated properly, this paradigm can get your applications out the door faster and free up company resources to build more.
In a nutshell, serverless computing, also called Functions as a Service (FaaS), is a further abstraction on what cloud computing platforms like AWS already do—making it easier than ever to get your applications up and running at scale. Serverless computing takes the power of a hosted cloud to a software level—it abstracts away the entire concept of the server. Instead, you just write functions. The provider takes care of how and where to run those functions, ensuring that you focus on code and not the hardware and systems that operationalize that code.
Serverless as an Extension of Public Cloud
To understand what serverless computing is and why it matters, it helps to understand how the shift to the public cloud impacted businesses. If you wanted to start a company that had anything to do with the internet before Amazon Web Services, you needed to setup your own infrastructure. That meant buying your own servers, networking them, monitoring and optimizing them, and a myriad of other complex and time consuming tasks. This would be a huge up-front investment and take a long time. Imagine having to spend your entire seed round on servers!
Enter public clouds—instead of building your own infrastructure, you can just pay to use someone else’s over the internet. Instead of paying for an entire server set, you just pay for the compute you use. If you build a sustainable business, AWS ends up being more expensive over time (usually an 18 month catch up) – but the fact that you didn’t have to invest all of that up front was transformational. A popular mental model became “turn your capital expenditures into operational expenditures,” or CapEx to OpEx.
At the core though, the architecture for applications remained largely the same. Deployment still required server side logic and code, and you had to write it. But you got to design that instead of physically building it. If we’re going to paint a broad stroke, public cloud computing was a hardware and networking advancement; not a software one. Serverless computing is an attempt at advancing the software that runs these things too.
What is Serverless / FaaS?
Mike Roberts says it well: “fundamentally FaaS is about running back end code without managing your own server systems or your own server applications.” Now instead of just running the hardware for your deployments, cloud platforms will run the server side logic. As far as developers are concerned, there are no more servers, only functions.
Well, that’s not entirely true. Your applications will still need to deal with the realities of running on hardware – you’ll have downtime, errors, bugs, and cost management. There’s a startup called IOPipe that will help monitor and manage your FaaS for you.
Fowler lists a few more important features of serverless computing that separate it from traditional server side architecture:
Coding Frameworks
Since serverless functions run by themselves, they can trigger other functions written in different languages or leveraging different frameworks. As long as you define the required dependencies in your deployment package, you’re good.
Upload
The process of actually getting your code to run in the FaaS framework is super easy—you literally can copy and paste it into the service provider’s console. Once you adjust the other parameters (e.g. upload dependencies), you can just click deploy.
Scaling
This is probably the most important feature of serverless frameworks: the provider takes care of the complexity around scaling your functions. Theoretically, you could go from 10 API calls today to 15 million tomorrow and be totally confident that your infrastructure would hold. There’s still some complexity to navigate around handling multiple copies of the same function running in parallel, but that’s written into the functions themselves. There’s nothing else to write it into.
To accomplish the same with current cloud computing, you’d use something like Amazon’s Elastic Load Balancing. You need to set up the logic, explicitly tell it when to spin up and shut down servers, and take care of the event handling. But by then, you’ve already built something like Lambda.
To summarize here, FaaS is basically a pre-built, easy to use combination of some of the services that most cloud providers already offer. The end product is an auto-scaled, easy-upload, and framework agnostic service where your functions run the show. The difference is that you don’t need to set most of it up, which can make a big difference for certain business use cases.
Business Use Cases of Serverless Computing
It’s easy to understand why serverless can make it easier for you to deploy your applications without having to worry about coordinating multiple parts of what your cloud providers offers. But in today’s business world you pay for simplicity, and serverless’ cost increase needs to be worth it. In addition to the cost factor, FaaS platforms like Lambda also have compute limitations that make it a bad fit for larger scale projects. For example, disk space is temporary and limited to 512MB, and functions will timeout if taking more than five minutes to execute.
What all if this means is that serverless needs to be a good fit—it’s not realistic to port over and entire application and say “we’re running this here now.” That’s why most of the well documented business use cases for serverless rarely represent a core product function. For example, here are some of the examples on Amazon’s Lambda page for use cases:
- Coca-Cola uses Lambda for some of the business logic in their Vending Pass program.
- Nordstrom utilized serverless to process some of the customer requests for their new recommendation engine.
- Thomson Reuters processes events for its usage analytics service with Lambda.
None of these businesses are shifting their entire applications over to a serverless architecture, but many are starting to integrate it into smaller parts of their stack or workflow.
As far as technical use cases, serverless can be used for almost anything. A few popular examples include:
- Operating serverless websites with functions as the serverless interface between the client browser and a database instance
- Interfacing with third-party services with a function handling the request
- Scheduling events with cron, but only paying for execution time
Serverless Works for More Than Just Computing
Another interesting and promising application of serverless is data storage. When you’re dealing with large amount of data, it gets technically challenging to maintain the right sized database and manage ETL processes and a data warehouse. Traditional database cloud services like Amazon’s RDS can also get prohibitively expensive—especially for early stage companies—when you scale a SQL based infrastructure to tens of millions of rows.
A few new managed databases services are relying on the serverless paradigm and promise the same benefits of FaaS in computing: we’ll take care of everything, and you worry about your business. Predictably, there are three major players in the serverless data space: Google, Amazon, and Microsoft. IBM’s Cloudant and Fauna are new entrants in the early stages.
Google’s offering is called BigQuery, and it’s a “serverless, highly scalable, low cost enterprise data warehouse designed to make all your data analysts productive.” Like with FaaS, you just upload your data and Google takes care of the rest. The pricing model of serverless data solutions charges both for storage and for querying, so you’ll be paying a premium for what you’re getting.
Amazon launched their Athena service in late 2016, and it’s a similar offering to Google. In their words, it’s “an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run.” Unlike with BigQuery, you need to set up your data in a separate service (S3) first.
The major difference between these two options is how they’re architected. Google’s BigQuery is entirely managed, from data storage to query. It can be safely labeled as a serverless data warehouse. Athena, on the other hand, is a bit more abstracted—instead of pushing your data to the warehouse, you can just query directly from your sources in S3. The end product ends up accomplishing the same task, but if you’ve already been storing your data on S3 then Athena might be easier to onboard.
Bigger picture, both of these options are presented as data warehouses, and as such are only solutions for analysis. You’ll still need to worry about how to store your core data and deal with that set of complexities. Look out for serverless to make its way into cold storage soon as the technology improves.