39

All the cloud providers are marketing their "serverless" solutions. The promise is that serverless is going to replace the way developers are currently develop their software, and operations manage it in production.

What is "serverless"? Where can one learn more about it, and how it can be used today?

  • serverless computing is "server less" as a "chicken burger" is vegan as you didn't personally meet the chicken – Sai Addanki May 2 at 23:13
41

Wikipedia's article on serverless computing provides a decent introduction to the topic:

Serverless computing, also known as function as a service (FaaS), is a cloud computing code execution model in which the cloud provider fully manages starting and stopping of a function's container platform as a service (PaaS) as necessary to serve requests, and requests are billed by an abstract measure of the resources required to satisfy the request, rather than per virtual machine, per hour.

The idea is that a developer shouldn't need to care about the server infrastructure at all. The cloud provider manages the physical servers, the operating system used and all the traditional difficulties involved with running a server.

Serverless computing changes your architecture from thinking about what machines are doing to what functions are doing. AWS Lambda is the example that comes to mind - you pay for and run functions, without any mention about what type of physical infrastructure is running below. There are also competing serverless hosts such as Azure Functions (or you can simply search if you're not interested in either of those).

There are quite a few advantages to serverless (although you do need to write in a slightly different way than you're used to in some cases, because it's a totally different architecture):

  • Scalability essentially comes for free - because you're just paying to run a function, the cloud provider can easily dedicate more hardware as needed to run your code. You can also potentially scale as demand rises, rather than paying a fixed rate whether your application is used once or a million times.

  • The server software and hardware no longer needs to be managed by a developer - the cloud provider handles that. If you've ever used something like Arch on a server, you'll know how easy it is to wipe out a critical package and break everything!

  • It frees up developers to focus on what they're good at - code. Most developers probably won't be great at both server infrastructure and programming - serverless just takes one problem out of the equation.

  • "shouldn't need to care about the server infrastructure at all". That's a really Good Thing because, in my experience, far too many of them already /don't/, with disastrous consequences! – Phill W. May 3 at 10:10
15

Martin Fowler has a good overview:
https://martinfowler.com/articles/serverless.html

TL;DR
"Serverless" describes application development and architecture that designs applications in which the infrastructure is ephemeral, meaning that they tend to be container-based and can "come and go" based on a dynamic scaling mechanism. This prescribes the use of stateless architectures that depend on distributed technologies (such as key/value stores.)

  • 2
    Not only ephemeral, but abstracted away completely. In many modern non-serverless setups (such as AWS EC2 ASGs), the infrastructure is also ephemeral; an EC2 instance in an ASG can be terminated at any time. – Adrian Mar 13 '17 at 20:28
14

'Serverless', like many things in our space, is becoming an overloaded term.. but generally what it means is "Functionally, Our architecture does not depend on the provisioning or ongoing maintenance of a server"

The first instance that comes to mind is a single page javascript app, that uses local storage, and is stored on something like Amazon S# or Github Pages (or any static site - those are just common examples). Imagine something like a 'todo' or 'getting things done'-style application that runs entirely in your browser. Your browser hits a service like S3 to download the code, and the items you store are all stored in local storage in your browser. There is no server you maintain for this.

The second instance, and is a bit more complicated (and also the one that popularized the term 'serverless'), uses a service like AWS Lambda. Let me explain this by presenting the problem it solves:

Many times in my career I've solved a business problem for a client with little more than some ruby code that performed a periodic extract, transform, and load (typically written as a rake task). Once solved, I'd typically automate it with cron. Then the problem becomes 'where do I host this thing that runs once every hour?' For some clients, we'd set up a server in their existing infrastructure. For others, we'd set up an EC2 instance, even though it was idle 99% of the time. In either of those circumstances, there is a server that requires provisioning, patching, monitoring, updating, etc.

With Amazon Lambda, I can take that rake task and run it on their service as a pure 'function'. I can even schedule it. No longer would that client need a piece of infrastructure for such a simple once-an-hour thing.

With 'serverless' there is still a server, just like with 'cloud' there is still a computer. There is just a level of abstraction on top of it that takes some of the environmental responsibilities for you.

  • My upvote for the real life example of once in an hour job that typically needed an EC2. Now you just need a Lambda function ! – HopeKing Nov 14 '17 at 3:45
10

All great answers already. I was going through the blog post Thinking Serverless — How New Approaches Address Modern Data Processing Needs in HighScalability, where I've come across this excellent explanation of what serverless means:

The phrase “serverless” doesn’t mean servers are no longer involved. It simply means that developers no longer have to think that much about them. Computing resources get used as services without having to manage around physical capacities or limits. Service providers increasingly take on the responsibility of managing servers, data stores and other infrastructure resources…Going serverless lets developers shift their focus from the server level to the task level. Serverless solutions let developers focus on what their application or system needs to do by taking away the complexity of the backend infrastructure.

And, one more learning from my personal experience in building serverless infrastructure is:

  • Serverless data pipelines don't really need to be real-time only. One can build efficient batch-processing serverless pipelines via AWS's CloudWatch alert mechanisms, which allows one to monitor the tools and raise alerts for (AWS)Lambda to compute.

Like for example: Store the files in an AWS SQS queue. Once the number of messages in the queue reaches 10, fire an event to Lambda.

6

Beside simply explaining the definition of the term Serverless, the origins of the term and it’s history give some insight as well into its meaning. The concept originated with the JAWS framework by Austen Collins, which got later renamed as Serverless. I've learned of it first in AWS re:Invent 2015 session, which can be helped to date the concept. This is what actually coined the term Serverless, which then spread quickly to other cloud systems:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.