Simple Workflow Service

https://www.udemy.com/aws-certified-solutions-architect-associate/learn/v4/t/lecture/2050710?start=15

What is SWF?

Simple Workflow Service is a web service that makes it easy to coordinate work across distributed application components.  SWF enables applications for a range of use cases, including media processing, web application back-ends, business process workflows, and analytics pipelines, to be designed as a coordination of tasks.  Tasks represent invocations of various processing steps in a application which can be performed by executable code, web service calls, human actions and scripts.

It is basically a way of coordinating tasks.

Amazon actually uses this system when a product is ordered through the Amazon website.

Example (Simplified)

  • Order is placed online using Credit Card
  • Credit card is successful.
  • New ‘job’ is created and order is sent to the warehouse
  • Person retrieves product from location the product is stored in
  • Product is boxed with shipping label applied
  • Product is shipped.

SWF vs SQS

  • SWF has a retention period of up to 1 year, vs 14 days for SQS.
  • SWF presents a task-oriented API vs SQS message-oriented API
  • SWF ensures that a task is assigned only once and is Never Duplicated.
  • SWF keeps track of all the tasks and events in an application.  With SQS you need to implement your won application level tracking, especially if you use multiple queues.

SWF Actors

  • Workflow Starters – An application that can initiate (start) a workflow.  This could be an e-commerce website when placing an order or a mobile app searching for bus times.
  • Deciders – Control the flow of activity tasks in a workflow execution.  If something has finished (or failed) a Decider determines what do to next.
  • Activity Workers – Carry out the activity tasks

LEAVE A COMMENT