2

我是 AWS SWF 的新手。仍处于学习和文件处理阶段。只是想出一个愚蠢的问题。对于顺序工作流的用例,我们是否应该将所有实现都放入一个大活动中,而不是定义将由决策者按顺序执行的一系列活动?由于工作流中的每个任务的收费为 0.000..25 美元,因此这种方式将为大规模节省更多资金。

对于这种用例,在保证顺序工作流执行中声明一系列小活动的充分理由是什么?

4

1 回答 1

3

If your use case is actually simple, you can declare a big activity (what is cheaper, as you stated), but in general the benefits of using a set of small activities are:

  • You can run a particular step (one of these activities) in a different set of workers (via a different task list), with specialized resources. For instance, you could run two farm of workers: one "regular" farm for general purposes, and one "Big CPU" farm for computing-intensive operations; all part of the same workflow execution.
  • Depending on how you execute activities (using Flow or your own worker runtime), you could retry failed activities separately.
  • You could version your activities independently, instead of just one version for the whole workflow.
  • If the workflow evolves, it would be easier to extend or update using a set of activities (one of the building blocks of your workflow).
  • If in the future you need to act after a workflow signal, you would have a hard time decoupling your logic to support it.
  • Atomic activities are potentially reusable by other workflow types (or even the same workflow: for instance, sending an email at the beginning and the end of the workflow).
于 2013-05-27T03:48:09.523 回答