Hacker News new | ask | show | jobs
by remify 52 days ago
I've built 2 applications using Lambdas as a backend and I love how simple and it is. It cost literally 0$ (the lambda part).

The frontend is hosted on cloudfront, the backend is a lambda and you basically just pay for the database and certificate.

I don't want to manage a server or even a docker image. I just want my code to exist there so I like the idea

4 comments

Are we pretending now it's less complicated to distribute an app a cross a variety of lambda functions? So how are you deploying it? Serverless Framework? SST? Mounting complexity compared to a container... There are also a bunch of services that let you simply host a container, no server to manage. Distributing apps on lambda is a classic trap, and also just because you can, doesn't mean you should. You will quickly find out local development, deployment, debugging, monitoring is all more complex and you will wonder how you got there.
> Are we pretending now it's less complicated to distribute an app a cross a variety of lambda functions?

I treat Lambda purely as compute and ignore everything else related to "serverless". My Lambda's are monolith webapps using Axum Rust framework. Using cargo lambda I generate a static binary, upload to s3 and point the lambda at it. Sometimes I'll package as a docker image so can run in Lambda or locally by passing a `--aws-lambda` flag.

If serving HTML i'll use Function URLS with IAM auth and put a Cloudflare worker in front acting as the gateway. I also serve the static assets from cloudfront bucket i.e. static.example.com. Advantage is I use Cloudflare free tier so get denial-of-wallet prevention when my free credits run out. Using IAM auth also means the lambda doesn't execute if for what ever reason someone discovers the url and tries to DoS it so only get charged for the requests not run time.

Yes. I found it was simpler to have a "fat" monolithic lambda than split up your logic across multiple lambdas. Easier to deploy, too.
Yeah I've worked on a website built on a bunch of Lambdas - something like 150 Lambdas that tied themselves in knots with both HTTP requests and message queues.

I ended up moving a bunch of the logic into an ECS-hosted monolith. Probably cost a bit more (warm-up plugins meant that no customers still cost us money) but it vastly simplified things and made scaling up easier (can't set scaling thresholds with Lambda).

It's just more effort then I want to or need to.

Just a lambda, a switch in the handler that calls my routes and that's it. I could make it smarter but I don't really need to

> I don't want to manage a server or even a docker image. I just want my code to exist there so I like the idea

agree, unfortunately in practice it's more common to throw the api behind k8s with containers

And then stick your code in an OpenFAAS container.
What certificate cost? Acm is free if you don’t export
lambda + DB is an antipattern.
direct connection can be problematic if you dont limit the scaling or don't use rds proxy yes.

The 3 lambda instances aren't going to break your db