News for hackers. Stuff that matters.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by jiggawatts on Sunday April 18, 2021 @08:11PM (#26857859)
You've discovered what many other people have: The cloud is the new time-share mainframe.

Programming in the 1960s to 80s was like this too. You'd develop some program in isolation, unable to properly run it. You "submit" it to the system, and it would be scheduled to run along with other workloads. You'd get a printout of the results back hours later, or even tomorrow. Rinse and repeat.

This work loop is incredibly inefficient, and was replaced by development that happened entirely locally on a workstation. This dramatically tightened the edit-compile-debug loop, down to seconds or at most minutes. Productivity skyrocketed, and most enterprises shifted the majority of their workload away from mainframes.

Now, in the 2020s, mainframes are back! They're just called "the cloud" now, but not much of their essential nature has changed other than the vendor name.

The cloud, just like mainframes:

- Does not provide all-local workstations. The only full-fidelity platform is the shared server.

- Is closed source. Only Amazon provides AWS. Only Microsoft provides Azure. Only Google provides GCP. You can't peer into their source code, it is all proprietary and even secret.

- Has a poor debugging experience. Shared platforms can't generally allow "invasive" debugging for security reasons. Their sheer size and complexity will mean that your visibility will always be limited. You'll never been able to get a stack trace that crosses into the internal calls of the platform services like S3 or Lambda. Contrast this with typical debugging where you can even trace into the OS kernel if you so choose.

- Are generally based on the "print the logs out" feedback mechanism, with all the usual issues of mainframes such as hours-long delays.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by Olreich on Sunday April 18, 2021 @10:25PM (#26858604)
While that’s generally true, the inputs and outputs and execution environment that you can count on is well-documented on AWS Lambda. That means that recreation of execution environment for the function in question is pretty reasonable locally (why is this not a thing then Amazon?!?). For the rest of AWS, you can either get credentials in place for access or mock those out somehow, but that’s not officially supported either.

I feel like the service is leaving a bunch of easy work on the table that would let people have a local development process that mirrors the remote development reality.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by scrollaway on Monday April 19, 2021 @07:34AM (#26861548)
It is a thing; unfortunately it's not officially supported but I also find it crazy that so many developers are fine doing dev directly on "the cloud", as if that's a reasonable use of their time.

https://github.com/lambci/docker-lambda

https://github.com/localstack/localstack

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by zerubeus on Tuesday April 20, 2021 @07:12AM (#26873092)
Lack of understanding, I think every new dev to serverless will have this stage of frustration, then eventually will find a way to do better with creative ideas, I myself never run lambda in the cloud I write a UT for my handler and assume I know the input and the expected output, I mock everything except step functions I use the official jar from AWS.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by bombcar on Sunday April 18, 2021 @08:46PM (#26858084)
People sometimes don’t understand the “why” of something like Literate Programming - it wasn’t really for documentation purposes. Part of it was to reduce as much as possible what we would call “compiler errors” as much as possible.

Arguably that’s a more dignified form of programming for a more elegant time but it doesn’t really mesh with the reality of “try fail print retry”.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by jxf on Monday April 19, 2021 @12:26PM (#26864582)
A fantastic summary. My bread and butter is helping companies get to the cloud, but my number one guideline is that the local developer experience must be supported as much as the infrastructure improvements are.

Otherwise, you get a mishmash of fantastic visibility into your workloads and better provisioning cycle times, which then immediately get cancelled out by developers who have to work 3x as hard to do the same thing they were doing before.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by chrisweekly on Monday April 19, 2021 @02:20AM (#26859596)
IMHO leveraging serverless properly generally means writing tiny, stateless, ephemeral, single-responsibility, "pure" functions. Cloudwatch might be underwhelming, but complicated debugging scenarios, with hours-long delays, isn't necessarily representative.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by Silhouette on Monday April 19, 2021 @06:29AM (#26861089)
IMHO leveraging serverless properly generally means writing tiny, stateless, ephemeral, single-responsibility, "pure" functions.

Unfortunately, what it most often seems to be used for is triggering side effects in response to some event, which is exactly the opposite of a pure function. Local testing of that logic is probably reliant on mocking all the other services it integrates with. Beyond that, the next step tends to be remote integration testing on the actual cloud hosting service, using some sort of separate staging infrastructure that will possibly be shared among many developers.

Some of the ideas and flexibility that should be offered by cloud hosting are appealing, but in practice, it often feels like we've regressed decades in our software development practices, discarding successful ideas like shorter feedback loops and unit testing and one-step build/deploy processes.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by meekins on Monday April 19, 2021 @08:57AM (#26862219)
> the next step tends to be remote integration testing on the actual cloud hosting service, using some sort of separate staging infrastructure that will possibly be shared among many developers

One of the results of the pay-per-use pricing model of services utilized in serverless architectures is that you can easily provision dirt-cheap developer and feature-branch specific environments for integration-level testing. While you still can't attach a debugger in your function, the isolation from changes others are working on makes testing and exploration much more pleasant than when working in a shared dev environment. Things only get complicated when your architecture includes more expensive components with different pricing schemes that you probably want to share with others (e.g. relational databases, data streams).

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by Silhouette on Monday April 19, 2021 @11:03AM (#26863487)
Things only get complicated when your architecture includes more expensive components with different pricing schemes that you probably want to share with others (e.g. relational databases, data streams).

But how often will that not be the case, realistically? By their nature, serverless functions have no persistent storage or other capabilities of their own. All they can do without communicating with other services is return some data to the caller.

So, if you really are writing a lambda to do some calculation on demand, that's OK. However, literally anything else is going to be integrated with other services in way or another. That will include some sort of database or other persistent storage if there is data to be retrieved or saved for future use. It might involve services that provide other effects, whether sending an email or collecting a payment or querying someone's geographical database API and sending a message to a user's phone giving them the nearest dining options.

It used to be a pain testing integrations with third party online APIs, because most of them don't provide support for spinning up a fresh simulated environment on demand to test against. (Did I mention that as an industry we seem to have regressed by decades in our standard practices?) But with some of these cloud services, we create the same problems even with our own systems, which seems like madness to me.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by meekins on Tuesday April 20, 2021 @07:10AM (#26873078)
I've been working on serverless applications for years now and the cases are quite rare TBH.

Static cost of data streams come up in data projects but even there it's trivial to consume data from shared streams in developer-specific environment since the stream pointer is managed in client side. The throughput required by even multiple occasionally consuming dev environments rarely requires provisioning streams above minimum capacity.

DynamoDB in on-demand mode is my go-to OLTP database until I know enough of runtime load characteristics to provision static capacity with autoscaling. For any non-prod (or load testing) environment on-demand mode is the best choice. Aurora Serverless is OK as well but has its warts and so far the cases where I really need a relational database in a greenfield project have been few and far between. Anything with complex query requirements goes to S3 and gets queried asynchronously or in batches via Athena. Not suitable for real-time cases though.

Things like queues, notifications and e-mails are handled by SQS or SNS and paid per usage. Websockets by API Gateway and Lambda.

Architecting for serverless requires a shift in mindset and tooling but as a benefit you get cheap isolated development environments and truly elastic production environments with very little ops burden.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by the_arun on Monday April 19, 2021 @03:28AM (#26859960)
Problem is aws or gcp or azure do not follow any standard spec for their services.

Ideally, they should first come up with a spec - and provide reference implementation.

Every provider will implement solutions for these standard specs. That way customers can use services for the spec. Customers can move between providers or work with multiple providers at the same time. Level playing field & let the best provider win the customer loyalty.

But, all providers want to lock in customers. So, we are at the wrong end of the stick.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by robertlagrant on Monday April 19, 2021 @04:20AM (#26860251)
GCP -> Kubernetes. Pretty portable.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by roguas on Monday April 19, 2021 @05:35PM (#26868205)
To some extent. I have seen tons of scenarios istio/loadbalancing/other managed services that cannot be easily reproducible without 'the cloud'. I would say it is much more portable.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by the_arun on Monday April 19, 2021 @10:44AM (#26863281)
I should have been bit more specific. I meant managed services like s3, dynamodb etc
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by roguas on Monday April 19, 2021 @05:33PM (#26868185)
s3 is pretty much defacto standardized api for object store... tons of others follow minio, digital ocean etc.

dynamodb despite being a heavily promoted product at aws is not really a staple, but a crutch since rdbms doesn't scale that well

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by penguin_linux on Monday April 19, 2021 @12:36AM (#26859140)
While I understand this viewpoint, and the comparison makes _some_ sense.. Kubernetes seems to solve all of these problems to me.

> Does not provide all-local workstations. - Solutions like minikube fix this.

> Only Amazon provides AWS. Only Microsoft provides Azure. Only Google provides GCP.

Kubernetes has the same developer experience everywhere. As far as OP's serverless trouble, why not just use knative?

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by danmaz74 on Monday April 19, 2021 @02:43AM (#26859736)
As long you only use k8s and no (other) managed services in the mix.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mk81 on Monday April 19, 2021 @09:00AM (#26862253)
In addition to K8s, the big clouds (and even DO) all support S3-compatible storage, SQL and Redis/Memstore.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by jokethrowaway on Monday April 19, 2021 @05:23AM (#26860680)
Kyma would be the FaaS replacement for k8s/knative

(I haven't tried it yet as the whole functions fad still hasn't hit me)

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mk81 on Monday April 19, 2021 @08:58AM (#26862222)
Haven't tried Kyma but I like OpenFaaS.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mraza007 on Monday April 19, 2021 @05:01AM (#26860501)
Wow I’m just amazed how you summed up the modern day development by giving an example from the past. I’m just curious we have three big cloud players at the moment Azure,AWS and GCP but do we have open source alternatives to their services that these cloud provides provide which you can host your self on large servers
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by zerubeus on Tuesday April 20, 2021 @07:32AM (#26873228)
k8s
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by pbourke on Sunday April 18, 2021 @11:30PM (#26858883)
> You'd get a printout of the results back hours later, or even tomorrow.

See also “big data” and machine learning.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by smbv on Monday April 19, 2021 @10:26AM (#26863078)
> Is closed source. Only Amazon provides AWS. Only Microsoft provides Azure. Only Google provides GCP. You can't peer into their source code, it is all proprietary and even secret.

I'm a big fan of [OpenStack](https://www.openstack.org/) as it is open source and definitely enterprise-grade.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by ShakataGaNai on Wednesday April 28, 2021 @02:53PM (#26972756)
This weeks episode of DevOps paradox talked ... a lot about this exact "we're back to the mainframe" thought process.

https://www.devopsparadox.com/episodes/does-history-repeat-i...

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by tdfirth on Monday April 19, 2021 @03:28AM (#26859959)
That's really interesting, thanks for sharing. I did not have the pleasure(?) of working in the industry back then, as is true of most developers these days.

Do you hold out hope for a similar transition to a better local development workflow? What do you think it might look like?

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by jiggawatts on Monday April 19, 2021 @04:42PM (#26867746)
The major cloud vendors have a vested interest to the tune of trillions of dollars for ensuring lock-in. All the cloud vendors want to become the next IBM, except this time with recurring revenue instead of one-time sales, something IBM never succeeded at despite trying very hard.

Openness, standardisation, commoditisation, and low-tier equivalent offerings are an anathema to the vision of these mega-corps. They will fight tooth and nail to prevent it.

Look at what Microsoft is doing: Instead of moving Azure features down to their IDEs, they are moving their IDE into the cloud! VS Code is Electron-based, which is to say it is just a local web server plus a web browser shell. It's not rocket science to move the server component into the cloud, and have the standard customer web browser be the front-end. I've noticed recently that this has started to happen. There's already a SQL query editor based on VS Code, and there's editors popping up for App Service and I think Functions also (equivalent to AWS Lambda).

This is the ultimate lock-in, where you develop "on" the platform directly, and have no hope of ever reproducing any part of it locally: the build system, the debugger, source control, tracing tools, or the IDE itself.

Other people in this thread mentioned local Kubernetes development flows. They're too busy drinking the Kool-aid. The cloud vendors are not interested in ever making this a long-term viable option and will find creative ways of making such open development practices non-tenable.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by zerubeus on Tuesday April 20, 2021 @07:35AM (#26873244)
There's already good projects doing it check the https://serverless-stack.com/
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by Bombthecat on Monday April 19, 2021 @03:27AM (#26859951)
Ibm cloud is especially bad. Tried api connect. There is no way! To get any logs, debug information or anything! Nothing! Zero! You only get what the api endpoint tells the client... It's insane..
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by pantulis on Monday April 19, 2021 @03:14AM (#26859887)
This is a great insight.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by bserge on Sunday April 18, 2021 @08:50PM (#26858107)
Wow, you put into words what I was feeling about modern development. And software in general. God forbid you make a completely offline program and (gasp) never update it, that's backwards, unacceptable, a terrible security risk, etc.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by xwolfi on Sunday April 18, 2021 @09:10PM (#26858219)
And it's so hard to convince management, all rewarded on innovative solution like firing the data center team to replace it with an enormous Microsoft Hybrid Cloud contract, that they're only buying something way inferior for a much higher price.

I envy the geniuses at Microsoft who can convince 60k+ software companies like mine where we're all engineer or mathematicians, led by incredibly clueless IT decision makers :D I've talked face to face with people from an other continent in charge of our switch to Azure, and he was neither aware nor involved in even the decision of Azure vs AWS vs Google Cloud. But he was in charge...

I came to learn that the main reason we chose Azure (but I think the biggest problem was to choose Cloud) was because we already had teams doing Windows maintenance, server management, etc: we had way more relationship with MS already than with Amazon or Google. Now we have it, it's beautiful, nobody uses it, people grudgingly do trainings, and make big presentation about Cloud strategies, while waiting for legal and compliance to allow us to connect to it. Since we figured after the contract was signed that it would be mostly illegal for us to give Microsoft any of our client data...

Whatever, happy to see sometimes other people struggling with the bewildering fact that we somehow regressed :D

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by oceanplexian on Sunday April 18, 2021 @09:48PM (#26858425)
Look on the bright side, when it comes crashing down, there will be a whole lot of money to be made in undoing the damage done by frameworks upon frameworks inside of containers/serverless locked up in proprietary cloud services and APIs. And there won't be a lot of competition, either, since the old timers are retiring and many of the younger engineers couldn't tell you how a Kernel Module or a POSIX Signal works if their lives depended on it.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by vineyardmike on Sunday April 18, 2021 @11:38PM (#26858931)
Yeah I’m sure the future is going back to kernel modules and posix

/s

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by piva00 on Monday April 19, 2021 @07:29AM (#26861504)
Everything old is new. I don't think anyone predicted that the future (our now) would be consisted of massively scaled timesharing systems, hehe.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mk89 on Monday April 19, 2021 @07:21AM (#26861432)
lol! This made my day.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by rk06 on Sunday April 18, 2021 @11:25PM (#26858859)
The genius at Amazon paced the road. Azure just walked on it.

To be honest though, I never had a full production system in my dev machine in my 5yrs career.

So, it is not different. If anything with microservice approach, it would be easier to test locally than it was before

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mcny on Monday April 19, 2021 @12:25AM (#26859084)
> To be honest though, I never had a full production system in my dev machine in my 5yrs career.

http://catern.com/run.html

I can understand it might not have been possible thirty or even twenty years ago but with modern systems such as the EPYC 7003[1] you can have a 64 core / 128 thread beast with 4 TB memory. Granted the processor alone costs $7890 but I can't imagine any system that won't run on a single top end modern computer, especially with dummy data.

Why don't we run the full production system on a development machine?

[1] https://www.anandtech.com/print/16529/amd-epyc-milan-review https://news.ycombinator.com/item?id=26466933

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mk89 on Monday April 19, 2021 @07:23AM (#26861454)
What's a full production system? Do you think you could run your company's production system on your most powerful MacBook pro?

I can probably run a few services. And then what for? Why would I run on my host something developed by a team I probably will never speak to?

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mcny on Monday April 19, 2021 @08:58AM (#26862228)
> powerful MacBook pro

Likely not on a laptop/notebook computer. I was thinking more like a modern desktop. I’ll even settle for a dedicated environment on some server farm somewhere.

However, I’d like to be able to run everything that is pertinent to my work and that we have access/expectation to edit/comment on.

Especially if you are just getting started with micro services and there are like nine microservices but only like three teams you are still expected to have input on all nine micro services even though your team is only directly responsible for three of them.

I think now that I think about it, I basically want a development environment for me with an easy story to debug without getting on VPN or something.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by mk89 on Tuesday April 20, 2021 @06:53AM (#26872965)
You can achieve that with a tool like Kustomize maybe. Or docker-compose.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by imwillofficial on Monday April 19, 2021 @12:02AM (#26859005)
Can I ask what country you're in? All the big cloud providers have infra that can handle even classified projects securely.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by Silhouette on Monday April 19, 2021 @04:25AM (#26860274)
That might be true technically, but there is a price to pay when governments insist on being able to pry into otherwise private data, and part of that price is that business entities operating within their jurisdiction may not be considered sufficiently trustworthy from a legal data protection point of view, particularly by business entities in other jurisdictions who have their own compliance obligations to worry about. This has been an issue for EU-US data sharing for years, it's a current issue for post-Brexit EU-UK relations, and if recent trends continue it may even become an issue for inter-state data transfer within the US. And those are all examples between relatively close allies with generally good diplomatic relations and comity.
Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by usr1106 on Monday April 19, 2021 @12:39AM (#26859156)
> The cloud is the new time-share mainframe.

> You'd get a printout of the results back hours later.

Not sure what you are trying to say: What you describe is not time-share, but batch processing.

Re:Ask HN: Does anyone else find the AWS Lambda developer ex... by junon on Monday April 19, 2021 @08:25AM (#26861944)
Eh? No, the "hours later" bit was because other people were using the mainframe. Not because it was "big data".