If you're running at 100% of the time, don't use a Lambda. If you're running for 10 seconds a day, a Lambda is cheaper than owning your own hardware.
Similarly, if a car rental costs $20/day, it would be silly to say that that's expensive because it will cost you $73,000 after 10 years. The needs of a car rental and car ownership are different.
If you're running it continuously for a year, then you should probably be using a reserved instance and not lambda. Lambda is for short bursts, not 1 year of continuous use.
Not necessarily, especially in a large company setting. Lambda allows you to scale and take care of spikey traffic. It also doesn't require server management. Servers are a pain in the butt.
True, but ECS and K8s both abstract aware the hardware and offer cheaper 24/7 workloads and get past the cold start problem (at the expense of slower spike responses).
And it costs even more if you need that Lambda function to have access to the internet.
A possibly useful comparison:
A Raspberry Pi 3 (~6.5 watts) costs $6.83 per year to run full-time (at 12 cents per kWh). You get a full computer with much more I/O.
However, there are a lot of other factors to consider:
- Initial cost of the hardware
- Time and energy spent maintaining/configuring the device
- Physical maintenance of the device - power/network/physical management/etc
- Lack of immediate access to I/O ramp-up and global replication
- Lack of direct integration into other AWS services/etc
AWS Lambda isn't a magic bullet, but it offers a lot of convenience to offset time and money spent on a DIY approach. I run a small static site/service that never breaks Lambda's free tier, but most of the cost goes to hosting a NAT gateway for it to have access to the internet. The benefit of hassle free, global access to the service I built and the underling services it runs on (Lambda/AWS in general) makes it worth the cost. I could setup the same service at home on a Raspi for pennies by comparison, but if my home internet goes down while I'm away, or a dog chews on an ethernet cable, it's a headache that I have to deal with personally - or I have to do remote tech-support to whoever is home: "Okay, you should see a Raspbery Pi. No...it's not a food. It's a computer. Whatever... I know it's a strange name. Anyway, is the cable plugged in? Do you see a blinking light?"
I find it similar to being able to use a rental car while visiting a foreign city vs just driving yours across the country to save some money. You might save some money, but it comes with extra time, maintenance, potential roadblocks (literally and figuratively), breakdowns that you will have to deal with personally, etc. It's really up to personal preference.
And write in any language, and have no OS/patches/updates/hardware to look after, have built in logging, a complex but robust authentication system, etc etc.
The service bills in ms's, and you are complainting about price for the year? For $66/year and a 3 year commit maybe get a T4g small with 2GB of ram vs .1GB?