4 ms·
Would someone share a problem they solved with Lambda and why?
by windows2020 5y ago
Would someone share a problem they solved with Lambda and why?
- tiew9Vii 5y agoInfrastructure/compute cost. For most cases, you need to be doing extremely large volumes of compute/traffic for ec2 instances to be cheaper. I find it easier to look at Lambda as another compute deployment target. If I can deploy my app on an ec2 instance, in Fargate, or on EKS I can usually deploy it on Lambda at a fraction of the cost if it's stateless or the state is external. The cost saved on the AWS bill you do trade elsewhere. Orchestration/integration. That has got better, though, with Serverless framework, Terraform, AWS SAM, but it is still non the less more moving pieces to orchestrate which is complexity over deploying a app to a static server. Due to orchestration/being a black box, I wasn't a massive fan of Lambda but slowly grew to appreciate it as it's got more feature-complete, and the cost savings can be huge. I can deploy a Lambda build using the Rust sdk that executes in 10-15ms at a price of $0.0000000017 per ms on the 128mb ARM instances (and that's more than enough for Rust Lambda apps generally). You also lose the tight Lambda coupling if you develop your code using Hexagonal Architecture/Ports Adaptors patterns. Lambda becomes another adaptor right at the edge of your app, so it's trivial to swap out build a CLI, standard web app/your typical serverside app etc. My code often has a CLI + Lambda entrypoint, with the CLI entry point being beneficial for dev/testing/prototyping.