Each lambda in the first group of n lambdas work on a section of a file. Then they each have data to send to each lambda of a second group of n lambdas.
How to do this communication ? If I put all n² data in different files on S3, the pricing is quadratic in n. Is there a way to solve this with a linear pricing ?
Is each invocation in the first batch spawning another n lambdas (so n^2 total invocations) which don’t depend on input from others in the first batch, or are you waiting for them all to finish before running a second batch of n invocations (so 2n in total) where each lambda in the second iteration requires input from all of the invocations in the first batch?
If it’s the first scenario then it seems like a good use case for SQS+SNS, if it’s the second then you might be able to use something like S3 Select, so that each lambda in the first batch can output a single file to s3 and invocations in the second batch can pull out only the sections which are relevant to them.
Lamda 1 takes in data and checks it against format, outputs same json or error. Next lambda is 1 of 3 enrichment processes, input json comes in, new data is added, forwarded to the next json.
The entire process works with a json data that is fed in and the outputted. During each lambda it adds data or does something with the data.
You control what data is supplied when you invoke the step function via the input. No reason you can’t supply multiple files that are read in parallel as a first step with outputs from each file passed to the next step.
I would need something like transpose. Because my lambdas would map each item into a list, and then I need to run the next step on the transpose of the result.
Think of it like a matrix. I want to run the same lambda function on all rows, then a different one on all the columns.