Pros Of Serverless Architecture Explained

Pros Of Serverless Architecture Explained

https://kruschecompany.com/blog/post/why-enterprises-choose-serverless-architecture


Related discussions:

Serverless is only cheaper when your app is barely used. This article, like almost all the others, presents a false dichotomy between Serverless and “worrying about Servers”. Guess what? Your team will still worry about servers, just won’t be able to control them. I’ve been running a serverless architecture for over two years, and there are plenty of other things to worry about and deal with, and the only reason the cost hasn’t come up is because our legacy product dwarfs it in spend.

Consider just the app tier. Let’s say you need to sustain 100 requests per second. “But what about downtime?” - just assume your load follows the sun, so it’s a global total, but never mind the regional differences in billing for simplicity:

- 259 million requests per month

- API gateway costs $3.5 * 259 = $900

- Lambda costs (1024MB minimum for sane p90 times, 300 ms billed) = $1300

What an you get for $2200 a month in Elastic Beanstalk? Fuck that - what can you get for $1000 a month in EB? No, fuck that, what can you get for $500 a month in EC2? 3 x m5.xlarge? If you can’t do 100 requests per second with that there’s something wrong with your app.

And that’s 100 requests per second. That’s a fart in the wind. This KC website looks like yet more technoshill crap. Point in case the study they linked is for an app that serves 15 requests per second. Fuck off. Sure, it’s probably got load spikes - but EB can scale to handle those, too.

To that point, you could scale up to 100 T3.smalls 8hrs/day for $500 a month. This means you can handle one request per second per literal server and still come out 3x cheaper than APIg/Lambda. Love these services but AWS needs to slash the costs by several factors.

And this doesn’t even touch spot instances! Engineering an api or event driven application to be tolerant to spot instance closure is trivial. Doing that would drive down costs even further.

I really think the serverless hype is being driven by A) people developing hobby apps which are cheap no matter what and then blogging about it or B) people “switching” to serverless and having a cost reduction, ignoring the fact that they actually rewrote and rearchitected their application and made it more efficient in some other way.

Serverless applications are easier to scale, but setting up an ASG isn’t too much more difficult either.

You don’t factor in any labor cost reductions as a result of serverless. This is likely the most significant cost saving as it would include server patching/maintenance.

What server/patching maintenance are you thinking of with regards to ec2? Assuming the same stateless architecture, an OS patch is just terminating an instance and letting the ASG bring a new one in.

It’s still a false dichotomy - most people can just run EB and be happy, update their solution stack once every month or when a significant event comes, and AWS takes care of the rest. EB AMIs already apply security patches automatically.

You will *never* spend $1000/mo on maintenance with Elastic Beanstalk over Lambda. Rather, you’ll spend another $500+/mo with APIg/Lambda dealing with other quirks and deficiencies. I have personally, single-handedly had the API Gateway team acknowledge and fix multiple bugs. My team has discovered and reported over a dozen bugs with AWS “serverless” services and we had _no_ way of fixing them ourselves or anything, we just had to wait for them, and there’s no SLA or anything, and we have enterprise support.

The last thing I need to read is another article on the pros of serverless.

I want to see the cons of serverless, beyond the multitude of cons we’ve already encountered.

especially when you can use Elastic Beanstalk, so, it’s not serverless.. but it’s not serverfull.. it’s serverlessless.

Not OP, but he’s probably thinking of OS and framework security patching?

If you’re doing an apples to apples comparison, then it’s only fair to assume your application instances are stateless and are behind an asg. In that case, an OS patch is just terminating an ec2 instance and letting it bring up a fresh one.

you didn’t say which ones you encountered :slight_smile:

- much more expensive

- unicorn solutions that only work in the cloud / vendor lock-in

- loss of control of execution environment (runtime, security patches, advanced configuration settings): it’s true they patch your shit for you, and they do it when they get around to it. if you’re in an enterprise, you get edicts from infosec that are like “this patch must be rolled out” - guess what? you can’t, and they might not for 24-48 hours, maybe even a week. your p1s are not their p1s.

- wildly variable performance (show me you p95 time for lambda, show me!)

- granular billing without insulation: this is a tough one, a web server can kind of buffer a bunch of shit and just start to perform more poorly but still meet an SLA (oh no responses are 750ms instead of 250ms!), with serverless you’ll get those random 750ms response times anyway, but you’ll be billed a lot more because the ‘buffer’ isn’t in the server, it’s in the platform, and so they will happily spin up more and more workers for you. explained more:

imagine your server is humming along accepting one request every second and it processes it in 100ms. suddenly a storm comes in, and it receives 10 requests per second. your response times jump because of the load, and now everybody is getting responses that take 500ms. you’re still paying for just that one server, and while the response time isn’t ideal, you can choose to spin up a new server or let it ride.

with serverless, you will have responses that vary wildly anyway between 100-500ms, so you can’t offer a tighter guarantee, but when those 10x requests will cost 10x as much.

it’s true, it costs nothing when it’s doing nothing (compared to the server) but the problem is when it is doing anything, it costs so much more then the server. ‘scale to 0’ is a very very very specific requirement that isn’t that important.

What labor code in server/patching maintenance? If you’re manually patching and babysitting EC2 instances, you’re doing it wrong.

If you don’t rework part of your application to take advantage of the new platform of course it’s inefficient? It’s very rare you get a magical bullet to hugely change things without having to do some work to adapt to the new platform.

We maintain a normal environment. You know how much time patching and maintenance takes up? Very little, it’s mostly automated. From what I’ve seen there is a major cost increase because of the time and mental load that falls on developers working on “serverless” apps. It’s more difficult and involved to debug, and as the app grows the complexity explodes because of the way FaaS apps work at their core.