4 ms·
I'm not really using DynamoDB to store data. I'm using it to sequence parallel requests going into the 'worker' that concatenates things together -- so two simu
by jimpick 10y ago
I'm not really using DynamoDB to store data. I'm using it to sequence parallel requests going into the 'worker' that concatenates things together -- so two simultaneous incoming comments don't clobber each other.
At the moment, I think only DynamoDB Streams and Kinesis event sources will batch events together and deliver them to a single function (instead of many parallel functions). It's hard to understand just by reading the docs.
http://docs.aws.amazon.com/lambda/latest/dg/intro-core-components.html http://docs.aws.amazon.com/lambda/latest/dg/intro-core-compo...
I think the platform is evolving quickly, so I wouldn't be surprised if they come up with some more options in the future. I'm using DynamoDB streams since it's cheaper than Kinesis.
- Arelius 10y agoThe problem with DynamoDB is it has minimum provisioned throughput requirements that would make this rather expensive for a blog that was not free-tier eligible even if it got no traffic at all. In contrast, SimpleDB seems to only charge for actual throughput used.
- jimpick 10y agoCorrect. I'm provisioning the minimum amount. I'd love to find a cheaper solution.
- hrez 10y agoWhy not SQS?
- jimpick 10y agoLambda doesn't support SQS as an event source yet.
- Mizza 10y agoIt does now via CW Events.
- jimpick 10y agoInteresting. I think that still might be the 'push' model and not the 'pull' model, so it might attempt to do work in parallel. http://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html http://docs.aws.amazon.com/lambda/latest/dg/intro-invocation... The Concurrent Executions section of this page suggests that anything other than Kinesis and Lambda Streams will cause parallel work, which is not what I want: http://docs.aws.amazon.com/lambda/latest/dg/intro-core-components.html#intro-core-components-event-sources http://docs.aws.amazon.com/lambda/latest/dg/intro-core-compo...
- hrez 10y agoYou could have scheduled events -> lambda poll SQS. Though now I wonder why not just do what you need to do right from API->lambda instead of intermediate batch.
- yarper 10y agoKinesis also produces many parallel runs if the load is sufficient unfortunately!
- jimpick 10y agoMy understanding that it's per shard. So if you never partition, only one lambda function will run at a time. Kinesis might be a good solution if you wanted to use this code to run a Disqus-scale service with millions of blogs. Not much would need to change.