Why the serverless revolution has stalled (2020)
infoq.com
infoq.com
The big issue, from my point of view, is that the programming model takes all the problems of microservices and adds more. Microservices make even trivial features into a distributed system, bringing all the difficulties of reasoning about code that distributed systems entail. Then add an opaque runtime and almost certainly a number of vendor specific services to handle state and other features the serverless model cannot address directly, and you have a recipe for slow development and frustrating debugging.
I could of course do flow control myself in the Cloud Run service, but it'd be nice if I could just switch to pull.
I'm scared to use serverless platform unless I don't have to put in my credit card lol.
I feel safe paying the same price every month despite my app growing. Servers are powerful these days and are very simple to maintain and scale using cloud platforms because they do it all for you lol.
The most annoying part is that Googles infrastructure for cloud computing is so much better than the others if you're willing to work within their ecosystem. Simple deployments, version management, rollbacks, etc... There is nothing quite like it. (Im not saying there aren't competitors, just that Google seems easiest to use)
We do all of this with Azure
I think the definition of serverless is too narrow (AWS lambdas/ Azure functions) and that serverless is really "I want to build apps, not manage infrastructure". That's not the same thing as putting everything onto functions.
I have a monolith we're preparing to move onto a managed container system (prolly AWS AppRunner). I don't want to manage K8 if I can help it, our app doesn't need complex server architecture.
Personally, I think it's just the next layer of abstraction up. Some won't benefit from serverless in the same way some are better off with in-house tin. I know some that need custom chipsets in-house, so can't even buy a stock rack server! However, many many web apps don't really need the control and will probably use facets of serverless over time. But it is still a revolution for old people like me that just don't want to manage servers anymore!
> (prolly AWS AppRunner).
AWS right now feels like the most lagging in serverless containers.If you get a chance, try out the DX with Google Cloud Run or GKE AutoPilot. Building and shipping to GCR is fast enough that it feels like a local build-run worflow. Google Cloud Run jobs are also fantastic and you get a pretty hefty free monthly grant (~60h of compute).
Both Azure Container Apps and GCR are true scale to zero whereas AppRunner is not and always maintains a minimum monthly baseline cost (~$5-6).
AWS feels the most behind in terms of its serverless container workload experience (I use AWS every day professionally, but use GCP and Azure for side projects).
Serverless was already a thing in 70s, in the mainframe era. In the 90s the pendulum moved to servers and server farms and nowadays is sliding back.
> The Problems With Serverless: > Limited Programming Languages > Vendor Lock > Performance
None of this is a real problem, the only thing that matters is the cost-effectiveness, and currently (2024) it's stil cheaper to run most of your software on "traditional VMs".
> The concept of letting users pay only for the time that code actually runs has
> been around since it was introduced as part of the Zimki PaaS in 2006, and the
> Google App Engine offered a very similar solution at around the same time.
You could argue the way you architect "serverless" services feels very similar to the way we built CGI scripts in the 90s. If you kept those scripts small, everyone of those would have been the equivalent of a serverless function today.
The whole dynamic web was bunch of PHP scripts in your home folder.
Even the early Amazon was a collection of Perl scripts glued together.
What's old is new again.
You know we used to place the code in .php files and ftp it and call it a day. There were tons of php hosting (anyone remember Dreamhost?) that can auto-scale in some way and bill by page views.
I think the serverless revolution is here just not in the way people originally dreamed.
The issue we had was getting the bin-packing right on our cluster, and we often ended up with 20% unallocated capacity per VM. Autopilot basically solves that (and probably pays for itself with only a few VMs) as you only pay for the K8s defined resources, and therefore only have 1 level of cost optimisation at the pod level, rather than 2 at the pod and VM level.
Do you have some recurring activities to babysit Lambda or is it zero maintenance for your team?
Main advantages: Server $$ significantly lower than CI/CD; Bottleneck becomes DB, can have 1000x instances no problem (but never use more than 5x). No EC2 to manage just deploy the docker.
Which you can also do with a Webhoster. Well, it depends a bit on what languages or environment they offer of course.
> without making architectural changes
I guess those pieces have a way to communicate with each other? So the point here is more that you are forced to work with an architecture which is from the beginning designed for pluggable pieces.
Normally we would have at minimum 2x Fargate "mediums" sitting around for redundancy. ~US$130/mth now our server costs <$5/mth. Our CI/CD is WAY more expensive.
Since I like React and the Next framework, Vercel is a one-stop shop for me now. With their new storage feature, I can start creating a fullstack web app very easily. Frontend, functions, and Postgres, all hosted one Vercel and very easily integrated.
Having a Postgres DB makes it very easy to export to a proper server in the future, if I need it
>resources used on serverless frameworks are typically paid for by the minute (or even by the second). This means that clients only pay for the time they are actually running code. This contrasts favorably with the traditional cloud-based virtual machine, where often you end up paying for a machine that sits idle much of the time.
I'm going to ask something very stupid because I'm very ignorant but... when do you need this?
In my mind you have scenario 1: the app never runs because no users, so running it 24/7 is a waste. In this case why cloud? Pay $5 a month for a simple web host?
Scenario 2: you are hitting 100% on a server and you need a second server but that second server will only use 1% most of the time. Again, why not just upgrade the server with your web host?
Scenario 3: you have a bajillion users on peak hours and a tenth of a bajillion on other hours. I assume you would have a business model that affords you to hire someone to manage scaling your infrastructure?
What am I missing in this picture?
I guess when this was written (3+ years ago) a lot of people were still high on the marketing hype so the reality seemed flat.
But I think we got some nice options.
(Which, of course, aren't silver bullets that solve all the problems.)
Serverless is like driverless.... Sure you might be in the backseat but there is a chauffeur up front and you pay a lot of money for that.
Unless your not paying for it (directly) --- serverless makes a LOT of sense if you have light weight tasks that can be distributed and you send it to "excess" infrastructure you already own/run.
I think FaaS turned out to be a largely bad idea.
Stuff like Fargate, GKE Autopilot and Cloud Run I would also consider "serverless" just in a weaker sense. I can see these platforms having pretty wide appeal for workloads that don't benefit from stronger control over the underlying VMs and networking.
The biggest selling point that seems somewhat legitimate is a bunch of these have scale to zero capability. This is pretty useful for on-demand code that is required very infrequently and for which cold-starts are a non-issue.
I think where they fall down is that once you run up against one of their hard constraints is that the cost of moving to something without those constraints acts as a high enough activation energy to instead contort the application architecture to work around said constraints. This I feel is very bad and leads to horrible results, especially when aforementioned platform is FaaS.
In practice if you know you are going to want to run any non-trivial long-running or stateful services you are just better off going k8s from the start. The API is good, the managed options are good, life is just less complicated when you don't need to deal with proprietary bullshit.
I don't quite understand this. You can pay for 1 physical/virtual server and have apache serve 2 different domain names, right? Can't you just drop your infrequent app there so it shares resources with, I don't know, your more regularly accessed website?
The only scenario I can imagine this would be useful is if you own zero servers or the code is incompatible with the server you do own for some reason.
That said there are some key things a scale to zero serverless app has that solution does not.
1. Isolation. Your infrequent function may very well be infrequent but it's execution could then impede other code executing on that box (if it's computationally or I/O intensive for instance), or expose other code on the box to security vulnerabilities.
2. Independence. Similar to above but more addressing logical segregation. Once you are sharing a server or say piggybacking on a monolith as an extra endpoint there is now a lot of conflated concerns. For instance auto-scaling algorithms etc may not work well with the sort of intermittent/infrequent execution and it would be much better living in it's own context for that reason. Other things that end up all jumbled up: Cost accounting, IaC/deployment/CI/CD, ownership, observability, etc.
Generally all of this still isn't enough to justify serverless but sometimes it could be... but in most of those cases just eating the cost of 1 replica and autoscaling on k8s is usually better.
"your code that handles HTTP requests must be able to startup, run, and shutdown effectively instantly"
aka "serve your HTTP without bloated long running processes."
aka `cgi-bin` scripts.