Amazon AWS Certified Developer Associate – Simple Workflow Service (SWF)

  • By
  • June 4, 2023
0 Comment

1. Introduction to SWF

Through it and just start with what SWF is. So Amazon Simple Workflow Service is a web service that makes it easy to coordinate work across distributed application components. Amazon Simple Workflow enables applications for a range of use cases including media processing, web application, back ends, business process workflows, and analytic pipelines to be designed as coordination of tasks.

Tasks represent invocations of various processing steps in an application, which can be performed by executable code, web service calls, human actions, and scripts. So let’s have a look at an example of what a Simple Workflow would look like. So in this example, basically I want you to imagine Amazon. com. So a customer has gone onto the website, they’ve selected or selected the products they wanted to buy, put it in their shopping cart and they’ve basically placed an order. So that’s where we start. That’s the start point.

And believe it or not, Amazon actually used Simple Workflow in their warehouses from what I’ve been told, to fulfill Amazon. com orders. So they really do use this or they really do practice what they preach. So in this scenario, you’ve got your customer order. The first step is to verify the order. So you have your EC. Two instances, for example, would be your order verifiers they go away and verify perhaps they’re checking that the order is in stock. Whether or not Amazon need to go and order it in based on whether it’s in stock. And you’re going to have a different you need some sort of decision logic here. So you’re going to break this into two different things. You’re going to have workers and deciders and we’ll come to that in the next slide.

Once we know that the order has been verified and you’ve got stock, we’re then going to try and charge the credit card that may or may not go through and that would change the scope of the workflow. Again, you’re going to need a worker and a decider. If the credit card has, the charge has been successful, we’re then going to ship the order.

So now you need human interaction. You need a human to go and get a toy. Let’s say Christmas is coming up and the parents have ordered a toy. Let’s say a fire truck. And somebody in the warehouse actually has to go and locate that fire truck. So they’ll get a notice on their PDA, might be using SNS, but let’s not confuse the issue. And they will go and get the fire truck. Once the fire truck has been boxed up and it’s ready to go, the human worker would then say, okay, I’ve marked this for shipment, it’s good to go.

And then there will be record completion. And in this there’ll be basically be a database saying, yes, it has been shipped, it has gone out the door, it’s been boxed up and it’s on its way. Here’s the tracking number. And then that’s the end of this particular workflow. So hopefully that example makes it a bit easier for you. So for the exam, you’re going to need to know what workers are, what deciders are. So a worker is a program that interacts with Amazon’s Simple Workflow Service to get tasks processed, receive tasks, and then return results. So basically, it’s going to get the task, process that task and then return a result for it. A decider is a program that controls the coordination of tasks, ie. They’re ordering concurrency and scheduling according to the application logic.

So the worker and decider can run on cloud infrastructure such as Amazon EC Two or on machines behind Firewalls. Amazon’s Simple Workflow brokers the interactions between workflows and deciders and the decider. It allows the decider to get a consistent view into the progress of tasks and to initiate new tasks in an ongoing manner.

At the same time, Amazon Simple Workflow stores tasks, assigns them to workers when they are ready, and monitors their progress. It ensures that a task is assigned only once and is never duplicated. Now that’s a really, really key point for your exam. The difference and the main difference between Simple Workflow and SQS is with Simple Workflow, a task is only assigned once and it is never duplicated. With SQS, you’ve got your message visibility timeout.

A task can be assigned multiple times and it could also be duplicated if something doesn’t complete in a certain length of time that will then go back to the Sqsq and it could be done twice accidentally. So the main difference between SWF and SQS is that with Simple Workflow Service, a task is only assigned once and is never duplicated.

Since Amazon’s Simple Workflow maintains the application state’s, durability, workers and deciders don’t have to keep track of Execution state, they can run independently and scale quickly. So if you remember the example where we had the factory, that decision logic is part of a domain. So a Simple Workflow domain is simply your workflow and activity types and the Workflow Execution itself are all scoped to a domain.

So think of a domain as a container. Domains isolate a set of types, execution and task lists from others within the same account. You can register a domain by using the AWS Management console or by using the Registered domain action. In the Amazon Simple Workflow API. The parameters are specified in JavaScript or JSON JavaScript object notation or JSON format.

So this would be a typical JSON domain registration. So you’ve got your name, you’ve got your description, and then you’ve got your Workflow Execution retention period, which is in days. How long is the retention period for this particular workflow? And then that brings on another point, which is an exam question. If you remember. With SQS, the maximum time you can have an SQS message in the queue is basically for 12 hours.

With Simple Workflow, your maximum workflow can be one year and the value is always measured in seconds. So again, if you’re being asked to compare a, you know, compare the two between Simple Workflow and SQS. SQS is much shorter time frames. We’re only talking 12 hours, whereas Simple Workflow is up to one year. So that really brings us on to the last slide, which is comparing SWF with SQS. So SWF presents a task orientated API. Whereas Amazon’s SQS offers a message orientated API. Amazon Simple Workflow ensures that a task is assigned only once and is never duplicated. With Amazon SQS, you need to handle duplicated messages and may also need to ensure that a message has been processed only once.

Amazon’s Simple Workflow keeps track of all the tasks and events in an application. With Amazon’s Simple Queue Service, you need to implement your own application level tracking, especially if your application uses multiple queues. So that’s it for this lecture on Simple Workflow service. It probably will only come up in one or two questions, and it’s basically going to be asking you where you should use Simple Workflow versus using SQS. And to be honest, sometimes those questions can be really tough. You have to sit there and think about it. The main thing I would consider if I was you is does the question involve any kind of human interaction? In which case you would be looking for Simple Workflow.

And then the other thing is, in terms of delivery time frames, are you looking for a twelve hour window or are you looking for something that’s going to be longer? And also if it might give you hints about talking about domains or workers and deciders those sorts of language or words are used, hint towards using Simple Workflow versus Simple Queue Services. If you’d see something in the exam that we haven’t covered, please let me know. And if you have any questions, also, please let me know. If you have the time, please move on to the next lecture. Thank you.

Comments
* The most recent comment are at the top

Interesting posts

The Growing Demand for IT Certifications in the Fintech Industry

The fintech industry is experiencing an unprecedented boom, driven by the relentless pace of technological innovation and the increasing integration of financial services with digital platforms. As the lines between finance and technology blur, the need for highly skilled professionals who can navigate both worlds is greater than ever. One of the most effective ways… Read More »

CompTIA Security+ vs. CEH: Entry-Level Cybersecurity Certifications Compared

In today’s digital world, cybersecurity is no longer just a technical concern; it’s a critical business priority. With cyber threats evolving rapidly, organizations of all sizes are seeking skilled professionals to protect their digital assets. For those looking to break into the cybersecurity field, earning a certification is a great way to validate your skills… Read More »

The Evolving Role of ITIL: What’s New in ITIL 4 Managing Professional Transition Exam?

If you’ve been in the IT service management (ITSM) world for a while, you’ve probably heard of ITIL – the framework that’s been guiding IT professionals in delivering high-quality services for decades. The Information Technology Infrastructure Library (ITIL) has evolved significantly over the years, and its latest iteration, ITIL 4, marks a substantial shift in… Read More »

SASE and Zero Trust: How New Security Architectures are Shaping Cisco’s CyberOps Certification

As cybersecurity threats become increasingly sophisticated and pervasive, traditional security models are proving inadequate for today’s complex digital environments. To address these challenges, modern security frameworks such as SASE (Secure Access Service Edge) and Zero Trust are revolutionizing how organizations protect their networks and data. Recognizing the shift towards these advanced security architectures, Cisco has… Read More »

CompTIA’s CASP+ (CAS-004) Gets Tougher: What’s New in Advanced Security Practitioner Certification?

The cybersecurity landscape is constantly evolving, and with it, the certifications that validate the expertise of security professionals must adapt to address new challenges and technologies. CompTIA’s CASP+ (CompTIA Advanced Security Practitioner) certification has long been a hallmark of advanced knowledge in cybersecurity, distinguishing those who are capable of designing, implementing, and managing enterprise-level security… Read More »

Azure DevOps Engineer Expert Certification: What’s Changed in the New AZ-400 Exam Blueprint?

The cloud landscape is evolving at a breakneck pace, and with it, the certifications that validate an IT professional’s skills. One such certification is the Microsoft Certified: DevOps Engineer Expert, which is validated through the AZ-400 exam. This exam has undergone significant changes to reflect the latest trends, tools, and methodologies in the DevOps world.… Read More »

img