Serverless is the new buzzwordy abstraction in cloud computing / web hosting technology. Your code is still running on a server, but you don't have to think about those servers at all. Instead of thinking about and paying for servers, you pay to have your code run.

Back in the day, if I wanted to run a website, I'd have a computer running a web server1. Maybe I'd pay a hosting company to run my web server on their computer, shared with other people like me.

Cloud computing allowed for more virtualization, and now I run my application in this amorphous group of computers, with parts of it cached all over the world, but I can still think of it as a program running on a computer — it's just a virtual computer running on a real one — and if I'm expecting high traffic, I'll prepare for it by paying for more computers (or "instances").

Serverless takes the abstraction slightly further. I no longer think about how many computers I'll need, virtual or otherwise. I don't tell my provider "I want eight dual-core instances each with 64GB of RAM available to handle all my traffic." Instead I tell them "Here's my code. Run it when someone visits my website." They say "Okay, it can't run for more than 50ms for a single request, and if you get more than 100,000 visits in a month, we'll charge you for each subsequent million, but we'll take care of making it run at any scale and then bill you only for what you use."

Serverless is particularly nice for simple things. If you need a massive database, you'll need to provision that separately. If you're just taking a request, doing some simple processing, and returning a response, or perhaps relaying it to another service, serverless can be ideal. Even if it can't run the core of your db-intensive business, it can be useful for the microservices that make it go — webhook handling, log ingestion, etc.

If you don't need any back-end processing at all, you'll likely be able to find a cheaper hosting solution — maybe an Amazon S3 bucket if you want to stick with the cloud — but if you need to run server-side code, but don't want to think about what server resources it will take for a given amount of traffic, it can be worth looking into.

The most notable serverless service is Amazon's Lambda service, but there are others. I've personally used Cloudflare Workers. With that, I'm paying them $5 / month, and that covers it unless I find myself getting hundreds of thousands of visits in a month. (I might have to fork over another $5 in that case.)

It's potentially cheaper than traditional cloud computing, and in some cases could be cheaper than regular hosting. The real benefit, though, is that you can focus on writing your code, not on the IT aspects of running a website.

1 We use "web server" to mean software like Apache as well as referring to the computer it's running on. Sorry. In this case, I mean the software.

Log in or register to write something here or to contact authors.