Hacker News new | ask | show | jobs
by gfosco 4047 days ago
To me, this is a great demonstration of why AWS Lambda is not the future. Amazon gave it a catchy name for the Rube Goldberg cluster that it is.
4 comments

On top of that, it seems to encourage an extremely wasteful and expensive use of resources. The blog post claims that it "costs just a few dollars per month, and in theory scales near infinitely" but as soon as you start scaling, the cost is going to grow a lot.

As an example, take the use of S3 as a "cache" for the most recent messages in each channel. Suppose you're hosting a decent-sized collection of chat rooms, handling a total of 100 messages/second. The PUT requests alone would run you over $1000/month, even though the same amount of traffic could be easily served by a single small EC2 instance for a few percent of the cost.

S3 alone is expensive enough that it often pays to rent managed servers or instances elsewhere to act as a frontend cache for any external access to the files if you for whatever reason "must" use S3 (durability would be a good justification - getting that right is hard; getting it to the point where you trust it to be right is even harder)

E.g. 1TB worth of retrievals from S3 can buy me a dedicated server with 16TB of disk space and 30TB of inclusive traffic. Doesn't take a very big cache hit ratio before caching all external reads becomes profitable.

If cost is a consideration, it's pretty rare for AWS to be the way to go for anything but batch processing where you need instances or short periods of time in the first place.

Lambda is good at discrete units of work, in an application already integrated with AWS, that may come either frequently or infrequently, where you don't necessarily want to have an app server running the whole time. Things like

- generating a thumbnail for an image uploaded to an S3 bucket

- processing in response to queue events

- generating stats and metrics on a schedule or in a response to events

This is the typical unbalance of code + configuration. The code can be very clear but you need to read a lot of documents to be able to configure it in a particular system.
Without consider that at that point you're totally locked in. Anyways a very interesting article! Thanks (the author) for sharing it!