News for hackers. Stuff that matters.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by goostavos on Saturday July 01, 2023 @05:48PM (#36555631)
I regularly review design from teams that turn reading a file from S3 and putting into into a database into, well, something that requires a design review. Some horrific monstrosity of step functions, lambdas, and glue. All because they've been told that serverless is the correct way to build "scalable" software.

If every time you add a new feature to your application you also have to add new infrastructure, I feel very, very strongly that you're doing it wrong. Sometimes? Sure. Every time? Embarrassing.

Cloud providers are surely pleased as punch that there is now an entire generation of developers that will argue vehemently that infrastructure that only grows over time is not only healthy, but the best way to build scalable software.

I have no idea what to call it other than "Marketing Material Driven Development".

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by hawk_ on Saturday July 01, 2023 @06:15PM (#36555886)
Resume driven development.

And on the flipside - One of the funniest justifications I have heard for companies using new fangled untried tech is to attract talent - no one wants to work on boring tech apparently for the fear of being outdated.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by beabetterdev on Saturday July 01, 2023 @06:31PM (#36556028)
Some call it "Promotion Driven Development" :)
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by 6510 on Sunday July 02, 2023 @02:20AM (#36558793)
I'm coining Self Driving Development. You read it here first! If you like big words Autonomous Development is also fine.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by Silhouette on Saturday July 01, 2023 @07:15PM (#36556323)
One of the funniest justifications I have heard for companies using new fangled untried tech is to attract talent - no one wants to work on boring tech apparently for the fear of being outdated.

I sometimes worry for the future of our industry because of exactly this. The culture of buzzword driven development has become enshrined in the recruitment process - often from both sides - because of this kind of vicious circle effect. Now anyone - again from either side - who tries to escape it and instead advocates using sensible, robust tech to build useful, good quality products risks becoming a pariah and seriously damaging their career as a candidate or their ability to recruit strong candidates as an employer. Of course this assumes we are judging career progress by level of seniority reached or compensation paid instead of more indirect achievements like producing something that provided real value to those who used it. But if we're being honest most people obviously will.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by vhcr on Saturday July 01, 2023 @09:06PM (#36557116)
The worst thing is that it works, I've been rejected at interviews because I didn't have micro-service experience.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by greenbeard on Sunday July 02, 2023 @06:27AM (#36560128)
Probably because they need someone to get them out of the mess they have created.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by peteradio on Sunday July 02, 2023 @08:04AM (#36560667)
Then they'd want de-micro-service experience!
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by s__s on Sunday July 02, 2023 @01:01PM (#36563312)
I was job hunting about a year ago and got rejected several times for this reason. The worst part? Each one was a small startup just trying to get a new product off the ground.

In one interview the engineer interviewing me explained how they didn’t have any paying customers, and then went on to describe an elaborate over-engineered micro-service based architecture he was working on.

The real kicker was that instead of asking me about my 20 years building products, or our infrastructure at my last gig that handled millions of customers across the globe, he instead wanted to watch me code some goofy coding quiz he had prepared.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by coredog64 on Saturday July 01, 2023 @06:24PM (#36555971)
> Some horrific monstrosity of step functions, lambdas, and glue

I could see that. Lambda has a 15 minute timeout, and if you’re processing something large you want an orchestrator that can manage retries. I don’t like the SFN developer experience, but it’s only like 15% worse than boto3.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by BXlnt2EachOther on Saturday July 01, 2023 @06:01PM (#36555755)
I have heard "Promotion-Driven Development" (when it's from the team/eng side)
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by nostrebored on Saturday July 01, 2023 @07:34PM (#36556477)
Why is spinning up new infrastructure wrong when that infrastructure is consumption based and easy to create?

Cloud providers don’t care about your serverless function utilization for 95% of people. A huge chunk of people will never pay more than a single digit serverless bill, regardless of if they have 450 lambdas or 40. If creating a new function matches your mental model of how things works, simplifies ops and log reading, or gives you access to a library in a different language, I’d say you made a great call.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by lozenge on Sunday July 02, 2023 @05:45AM (#36559914)
Sure, creating is easy, what about monitoring, testing, rate limiting, updating (it can't be atomically updated with another resource, good luck testing that), security patching? What if you create a condition which causes an infinite loop of invocations? This is really rare in monoliths because we all agree on patterns like MVC that determine who calls what. When Conway s Law determines your infrastructure this is no longer the case.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rajamaka on Sunday July 02, 2023 @07:08AM (#36560316)
I have worked with serverless for years and all of these are ranging from completely non issues to easily solvable.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by namaria on Tuesday July 04, 2023 @04:30AM (#36583812)
"I haven't had this problem therefore it doesn't exist."
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by nostrebored on Tuesday July 04, 2023 @02:41PM (#36590928)
All of the problems the OP mentioned are really trivial with every serverless stack I’ve ever used.

Like many of the problems (security patching, monitoring, logging) are part of the serverless pitch.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by namaria on Tuesday July 04, 2023 @03:32PM (#36591547)
Yes cloud services make it trivial to set up and run software offerings. They are designed so it is easy to enter and hard to leave. And they make things unnecessarily complicated and expensive over if it grows to any non trivial degree. By then you're stuck rationalizing your previous choice because it would be very costly and complicated to move away. I'm glad you haven't had these problems, but it doesn't mean they don't exist. The issue is, when you have one of these 'good to have' scaling problems after going all in on cloud vendor hype, it's too late. So random internet strangers who have seen the issues that lie ahead try to warn other people. Some will arrogantly say they see no problem, full steam ahead. That'll just mean they will have only themselves to blame if they ever find themselves in this quagmire.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rewmie on Saturday July 01, 2023 @07:54PM (#36556599)
> If every time you add a new feature to your application you also have to add new infrastructure, I feel very, very strongly that you're doing it wrong. Sometimes? Sure. Every time? Embarrassing.

I have to call out your take because it's either outright wrong or is overgeneralizing, to put it politely.

A lambda is just someone else's computer running your function, which you call through a fancy rpc interface. There is no infrastructure.

Just because you can and should deploy a lambda with infrastructure-as-code tools such as CloudFormation or CDK, it still does not make a lambda "infrastructure". It's just your function running on space CPU cycles of someone else's computer, which you call through RPC.

Running your lambda as a background task in someone else's computer does not make it infrastructure, just like running code in your own server is not adding infrastructure.

Also, it seems you're missing the whole point of offloading background processes out of your servers. If they are computationally demanding and your servers are well provisioned them a background task can lead your system to scale up. You don't change the way your system is deployed or is operating if you run your background task as a lambda. You make a request and things run just the same. Zero potential for alarms and being paged in the middle of the night.

And more importantly, for some usecases lambdas are entirely free. Does this have no value to you?

Some people feel compelled to criticize everyone around them just to feel self important. A little humility would serve them well. Just because you fail to understand something's traits and properties that does not mean everyone else around you is wrong and you are the only enlightened soul who is right.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by starttoaster on Saturday July 01, 2023 @09:10PM (#36557156)
The term "infrastructure" has kind of a loose and fuzzy definition these days. But basically I think of a serverless function as like a one-shot container that is spun up when a webhook or some other invocation method is called, handles some kind of request, puts out some kind of response, and shuts down. A container is infrastructure, ECS is infrastructure. Therefore a Lambda is some kind of ephemeral invocation-based infrastructure. It's infrastructure the whole way down.

My personal take here is just that serverless functions have a time and a place in one's infrastructure, and it requires good engineering to determine where that time or place is or isn't. We use Cloudflare Workers fairly heavily, for example, to perform web redirects for some statically generated sites. It's a fairly sensical use-case for "serverless" in my opinion.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rewmie on Sunday July 02, 2023 @03:26AM (#36559141)
> But basically I think of a serverless function as like a one-shot container (...)

Implementation details don't really matter. The CloudFormation/CDK deployment of a lambda can include only the source code of the task you want to run. We don't know if AWS uses containers, an intern pressing enter, or purple unicorns.

> Therefore a Lambda is some kind of ephemeral invocation-based infrastructure.

Not really. A lambda is your function running somewhere. Unless you explicitly create your lambdas as runnable containers instead of simply passing your handler's code, you don't know or care how are things under the hood.

> My personal take here is just that serverless functions have a time and a place in one's infrastructure, and it requires good engineering to determine where that time or place is or isn't.

There is no magic or arcane wizardry involved. If you need to peel a background task out of a server that doesn't run that often and requires no internal data other than input parameters and takes far less than 15min to run, and you're already on AWS, then lambdas are far easier to implement and to run and to operate than modifying some server deployment to include support for a background task. In some cases, they can also be free to run.

There's also the usecase for plugging together AWS events, such as processing a file that's uploaded to a S3 bucket.

If you are already neck deep in AWS, lambdas are not an arcane trick that only fit weird corner cases. You need to know what's the free tier, lambda pricing scheme, and do back of the napkin math to figure out where it makes sense to you to switch from lambdas to a dedicated service.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by starttoaster on Sunday July 02, 2023 @03:00PM (#36564532)
> Implementation details don't really matter. The CloudFormation/CDK deployment of a lambda can include only the source code of the task you want to run. We don't know if AWS uses containers, an intern pressing enter, or purple unicorns.

I'd argue the intern pressing enter at AWS is my infrastructure.

> Not really. A lambda is your function running somewhere. Unless you explicitly create your lambdas as runnable containers instead of simply passing your handler's code, you don't know or care how are things under the hood.

I feel like you took my pragmatic explanation and obfuscated it.

> There is no magic or arcane wizardry involved.

Never said there was, I think you think that I'm more confused than I am. I run my own serverless platform, and make use of serverless platforms from other companies. I know how they work.

> then lambdas are far easier to implement and to run and to operate than modifying some server deployment to include support for a background task. In some cases, they can also be free to run.

You're trying to sell me on lambdas again. I said I already make use of serverless. I just am saying there is a time and place for them, and a time where they don't make any sense. You seem to be agreeing with me, where you placed a few qualifiers on when you should use a Lambda, so I don't know why you're framing this like we're in disagreement. Maybe you're confused as to what I actually said?

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by _dain_ on Sunday July 02, 2023 @07:19AM (#36560375)
>But basically I think of a serverless function as like a one-shot container that is spun up when a webhook or some other invocation method is called, handles some kind of request, puts out some kind of response, and shuts down.

we used to call those "cgi scripts"

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by Maxion on Sunday July 02, 2023 @01:59AM (#36558669)
You’re right on the money but I think what you’re missing is people are using lambda functions not just to run some image resizing function, but as their entire backend.

That’s the part that’s being critiqued.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rewmie on Sunday July 02, 2023 @03:36AM (#36559199)
> but I think what you’re missing is people are using lambda functions not just to run some image resizing function, but as their entire backend.

Sometimes it makes sense. I see people criticizing stuff they know nothing about.

I worked on a project where I had to put together a REST API for an internal project. After considering the traffic projections, we noticed a API Gateway + lambdas fitted quite neatly in the AWS free tier, and we did everything in lambdas. We also did a proof of concept in ECS and everything was far more complex and convoluted. With lambdas, the whole project consisted of a single CDK package which included also the nodejs code for the handlers.

In another project, we even skipped the API gateway and instead had a NLB invoke a couple of lambdas. It worked flawlessly, and in the free tier.

I'm seeing comments about the need to do engineering, but these same comments are outright clueless and fail to do the faintest cursory research. It's just people commenting on stuff they know nothing about with a demeaning tone. Not cool, not smart.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rajamaka on Sunday July 02, 2023 @07:16AM (#36560358)
You're completely right, the only criticisms of serverless in this bizarre thread are from a complete lack of understanding or experience
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by Maxion on Sunday July 02, 2023 @04:37PM (#36565433)
I guess a lot depends on your developer costs, a docker in e.g. GCPs cloud run costs peanuts compared to a devs salary per month.

IMO the less you need to code on top of your actual business logic functions - the better off you are for small projects.

Docker is still one of the best options, as if your tiny app is somehow business critical you can easily migrate it to other infra. With lambdas you’re stuck on AWS.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rewmie on Monday July 03, 2023 @02:54AM (#36569662)
> With lambdas you’re stuck on AWS.

You're not getting stuck on AWS because you added a lambda to offload a background task, or because you implemented a low-traffic REST API with API Gateway. If you're rethinking where you deploy services, your decision won't factor in these irrelevant details. Odds are you are more concerned with S3 and CloudWatch than REST APIs.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rvdginste on Sunday July 02, 2023 @04:07AM (#36559376)
> A lambda is just someone else's computer running your function, which you call through a fancy rpc interface. There is no infrastructure.

“someone else’s computer” _is_ infrastructure. _everything_ you run in cloud runs on someone else’s computer. Besides, you need to specify the amount of cpu and ram you need for your lambda, the kind of scaling you want, whether you can live with a cold start or not, optimise that cold start, potentially configure networking and so on. You can claim all you want, in the end it is an extra piece of infrastructure that you have to be aware of and configure.

> You don't change the way your system is deployed or is operating if you run your background task as a lambda.

Seriously? You do not need some kind of authentication to call your lambda? The lambda does not need access to some kind of private data to store its results? You won’t introduce a queue or something to offload background tasks?

I think it is naive to state that introducing lambdas into the architecture of an application does not have an impact on the infrastructure you need for it. And it makes me honestly wonder how much experience you have with lambdas or functions on production systems.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by rewmie on Sunday July 02, 2023 @05:23AM (#36559789)
> "someone else’s computer” _is_ infrastructure. _everything_ you run in cloud runs on someone else’s computer.

That's meaningless pedantry. You don't talk nor care about infrastructure when you're adding a controller to one of your services, or when a container scales up.

The only thing that matters are the relevant attributes like performance and operational costs. You don't care if running a task in the background ends up scaling up your service, just like you don't care about that when running the same task in a function-as-a-service service like AWS Lambda. You only care if your system is stable and the invoice you get at the end of the month.

If your mental model cares about meaningless low-level details that do not factor in your operations, your mental model is brokenand you have no business lecturing others on how they are doing things wrong.

> Seriously? You do not need some kind of authentication to call your lambda?

You don't, if you configured them right.

> The lambda does not need access to some kind of private data to store its results?

What? It does not have any extra requirements than calling them from a service running on EC2, ECS, Fargate, EKS, whatever. It's an internal AWS service that, just like any AWS service, is covered by AWS' access management. In fact, arguably it has less requirements, specially considering least-privilege policies.

> I think it is naive to state that introducing lambdas into the architecture of an application does not have an impact on the infrastructure you need for it.

I argue that talking about infrastructure when talking about function-as-a-service is ignorant and naive, and reflects lack of insight and first-hand experience which materializes in a mental model that's fundamentally broken.

And people suffering from this problem should not be making bold statements about something they know nothing about.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by throwaway2990 on Sunday July 02, 2023 @05:58AM (#36559977)
> Some horrific monstrosity of step functions, lambdas, and glue. All because they've been told that serverless is the correct way to build "scalable" software.

If it’s a horrific monstrosity it’s either because you don’t understand it or it was poorly done.

Seen several .NET step function implementations which were clean and easy to understand. And we’re cheaper than what they replaced. And new devs could easily pick it up and understand it.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by hk1337 on Sunday July 02, 2023 @06:42AM (#36560192)
> I regularly review design from teams that turn reading a file from S3 and putting into into a database into, well, something that requires a design review. Some horrific monstrosity of step functions, lambdas, and glue. All because they've been told that serverless is the correct way to build "scalable" software.

This is typically true with a lot of ClickOps teams.

Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by andrewstuart on Sunday July 02, 2023 @06:55AM (#36560243)
“Cloud Driven Development”.
Re:Serverless to Monolith – Should Serverless Lovers Be Worr... by chalcolithic on Sunday July 02, 2023 @01:46PM (#36563715)
I use Lambda for personal projects because at that scale it's free. OTOH I can't find a job and when I'm lucky enough to get detailed feedback it's always "you don't have a significant cloud experience"