Intro to Node on AWS Lambda for S3 and Kinesis
eng.localytics.com
eng.localytics.com
My ask HN post from earlier today basically asking the same thing https://news.ycombinator.com/item?id=9520964
A small anecdote: Lambda processes are _very_ cheap most of the time. When I was writing the initial version of this starter module, I accidentally threw the lambda into an infinite loop. It was triggered about 30k times within a minute or so and ended up costing around 13 cents if I remember correctly.
Of course, you then need to make sure your billing script successfully terminates any processes that are costing money.
I'd love to see AWS implement hard cost limits for services like this. e.g. specify you want to spend a maximum of $10/day, and once you reach that limit your service is temporarily suspended.
Edit: my mistake - you still can't have multiple lambdas operating on a single S3 bucket. I had triggered an infinite loop by manipulating files in the same bucket that it was triggered on (triggering another execution, infinitely).
Edit: realized my mistake in the wording of my comment above - _how_ I made the infinite loop had escaped me for a moment.
I have a Lambda for processing large files; the first phase is a single Lambda splitting the file into chunks which can be processed within the 60 second limit, and then the second phase is a bunch of the same Lambdas processing those chunks.
(Disclosure: I work with nicksergeant at Localytics.)
setTimeout(function() { throw new Error('timeout'); }, 1000)(Although custom events http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-cust... suggest its pretty close to real time; should measure the latency).