I'm writing a workflow using Amazon SWF and was wondering how to control the TPS on downstream services.
I have a parent workflow that kicks off several child workflows that run in parallel.
My child workflow calls several downstream services (each within a different activity) eg.
- call downstream service 1, if success proceed, if fail exit
- call downstream service 2, if success proceed, if fail exit
- etc
and I want to be able to manage the TPS on the downstream services separately.
How can I limit TPS on the downstream services? For example I ideally want to be able to say I want a max TPS of 100 for downstream service 1. In a non concurrent context I could use something like a Guava RateLimiter, however this will be running across multiple hosts. Can I specify I only want 100 instances of a given activity running at a time? I couldn't find an annotation in the flow framework for that (I am using the Flow framework and Spring). I am happy to break the child workflows into separate workflows if required and have the parent workflow call each child workflow one after the other, eg.
child workflow:
1. take entity id as input
2. call dependent service 1 workflow
3. return
Then if the above completes successfully then the parent workflow will call the next child workflow that calls dependent service 2, or if it fails the parent will quit.
Is it possible to have the concurrency limits on the number of instances of a given dependent service workflow or on a given activity? Is this a good/potential usage of Task Lists? Can I control the TPS via the number of worker hosts?
Thanks for any suggestions!