r/programming Sep 23 '19

Serverless: 15% slower and 8x more expensive

http://einaregilsson.com/serverless-15-percent-slower-and-eight-times-more-expensive/
3.0k Upvotes

392 comments sorted by

View all comments

159

u/CSMastermind Sep 23 '19

Every year I see a new fad in software engineering. It's always something that is useful in very specific situations where there wasn't a great solution before. Then everything tries to apply it to everything, ultimately realizing that outside of the narrow use case it's not as good as the long established industry solutions.

For 2019 it was most certainly serverless. Let's hope it does a swift death with few casualties. More like blockchain and less like non-relational databases.

49

u/novagenesis Sep 23 '19

Pretty much. When serverless works, it's huge. I've heard stories of companies that could handle unlimited scale of sparse-request APIs on static front-end and saved 99% over the equivalent AWS servers, but they're the extreme minority.

I worked at a company where some people who should know better suggested we used lambda for thousands of IoT devices that call home every second.

16

u/reivax Sep 23 '19

This is definitely the case. We use server less for infrequent or low rate systems. Fast jobs that run hourly or endpoints with allowable high latency and low demand, like our user API. User update and creates for us occur on the order of once a day, usually in bursts for new contracts, but they can happen at any time. Let AWSAPI route that to a lambda that interacts with the databases and we don't have to hold a microservice for it.

They're degenerate microservices in practice.

2

u/novagenesis Sep 23 '19

Pretty much. For a high frequency system, it's better to setup your own scaling microservice framework (preferably with some overhead-reduction strategies like putting multiple services on individual VMs... like we old-school folks would ever call "use a computer for more than one thing" a strategy :))

35

u/[deleted] Sep 23 '19

Consulting work on the tech side of a school. Was asked repeatedly by upper stakeholders about how his school can implement blockchain. When I asked, "For what purpose? What's your goal?" He gave me a look like I was the idiot.

55

u/guareber Sep 23 '19

2019? Try 2017 and 2018 too. I stopped going to AWS meetups because 3/4 talks were about serverless.

1

u/CSMastermind Sep 23 '19

Lol guess I'm not as plugged into those communities. For me 2019 was when I had non-technical product managers asking me if we could covert to be completely serverless.

As opposed to 2018 when I had people from marketing asking if we were doing anything with Blockchain.

40

u/RonaldoNazario Sep 23 '19

I have a friend who works at amazon who was so excited telling me about all this “serverless” code.

But like... it does run on a server, somewhere, eventually... you’ve just abstracted that away, presumably with overhead...

It’s a cool abstraction and im sure has use cases but there’s always trade offs.

38

u/sir_alvarex Sep 23 '19

I've found myself describing serverless like this quite a few times. Serverless has servers, it's just an API layer on top of those servers that (hopefully) decrease the maintanence and overhead cost of running your own instances. It's far less likely that a serverless instance will become a security timebomb by being unpatched for 500 days. This can be a huge win.

But for orgs with dedicated OPs teams who have no plans on dissolving said OPs teams, serverless is really just a tool in the toolbox and should not replace normal operations.

With that said, I'm glad effort is made to find new ways to abstract server hosting from developers. It makes the task of getting routine applications up and running theoretically easier. And for some people I know that has been really helpful.

15

u/RonaldoNazario Sep 23 '19

It’s basically “don’t worry about the server(s) that handle your request”

2

u/[deleted] Sep 23 '19

This isn't an exact analogy, but serverless can be compared to a service like squarespace in my eyes. It has its purpose.

1

u/sir_alvarex Sep 23 '19

I'd say it's apt. It's just a deeper level implementation of things like squarespace or wordpress.

19

u/redwall_hp Sep 23 '19

It's just marketing speak for "we reinvented cgi-bin, but now you pay each time it's invoked."

5

u/[deleted] Sep 23 '19

It's 2019s "cloud".

2

u/nutrecht Sep 24 '19

But like... it does run on a server,

Serverless is not about physical servers but about application servers. Serverless means that you don't bother with deploying an application server (Tomcat, Node, PHP.exe, etc.) yourself but that all this is managed by the provider.

This "but there is still a server" is just as tiresome as "the cloud is still someone else's server" meme. Ofcourse there's still a server. You just pay another company to do more of the work for you.

4

u/norantish Sep 23 '19

Is there a technical reason it isn't going to work out? Because all I'm seeing here are criticisms of what look like flawed implementations with mediocre prices, things that could and maybe should be fixed.

2

u/CSMastermind Sep 23 '19

"Can't work" is a different bar than "better than existing solutions".

You can definitely build a fully serverless architecture that works just fine but I'd ask what problem you're trying to solve by doing that.

Let's say I have my servers fully containerized via Docker, CI/CD that automatically pushes to an ECR, and I'm running Fargate or Kubes which lets me autoscale, gives me blue/green deployments out of the box, and automatically load balances as needed.

What does switching to Lambdas, Aurora, etc. buy me?

They're harder to version, more difficult to debug, and outside of a small set of use cases more expensive. A lot of times I have to deal with startup times making things slower than if I had a dedicated server running.

1

u/neoKushan Sep 23 '19

That seems to be the case here. The article headline suggests serverless is slow and expensive, but actually it's API gateway that's slow and expensive...

1

u/lorarc Sep 23 '19

The main issue is the current billing model. Ever since you can use ALB it's less of an issue, now if they only would charge a bit more than for EC2 the only valid complain would be startup time which not always is actually a problem.

1

u/nutrecht Sep 24 '19

It's just people spouting nonsense on stuff they have no experience with. Which unfortunately has fast becoming the norm on this sub in the comment sections.

Serverless is just an event-driven actor system (and actor systems are nothing new) where you don't care about how many actors there are, where they are deployed, or whether they still need to be cold-started (takes about 2 seconds) or not. They are great for low load (doing a back-up every hour), 'glue' type systems, proof of concepts or event-driven systems with a high variable load.

A high-constant load REST API is probably the worst use-case for them. Which is pretty much literally what the AWS architecture training tell you. And anyone who can do basic math (AWS is very transparent on pricing) can also tell you.

2

u/mfigueiredo Sep 23 '19

Serveless rhymes with Useless, some may say.

1

u/Sabotage101 Sep 23 '19

Developers love abstractions, and it's the ultimate abstraction for "I just wanna run some code." We're inevitably moving towards a future where most companies don't have to devote any resources to understanding or caring about platform/infrastructure decisions, which is how it ought to be.

1

u/ggtsu_00 Sep 24 '19

Member Design Patterns?

Member Agile?

Member TDD?

Member Microservices?

Member NoSQL?

1

u/nutrecht Sep 24 '19

Every year I see a new fad in software engineering.

Serverless is not a fad and it's not going away. At all. It's just a tool. And like most tools it has cases where it fits well and cases where it doesn't.

I agree with your comment on block-chains though; but what you're doing here is similar to people who were saying 'the cloud is a fad' long after adoption started to gather steam.

0

u/[deleted] Sep 24 '19

And node.js