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

Achieving Your ISO Certification Made Simple

So, you’ve decided to step up your game and snag that ISO certification, huh? Good on you! Whether it’s to polish your company’s reputation, meet supplier requirements, or enhance operational efficiency, getting ISO certified is like telling the world, “Hey, we really know what we’re doing!” But, like with any worthwhile endeavor, the road to… Read More »

What is Replacing Microsoft MCSA Certification?

Hey there! If you’ve been around the IT block for a while, you might fondly remember when bagging a Microsoft Certified Solutions Associate (MCSA) certification was almost a rite of passage for IT pros. This badge of honor was crucial for those who wanted to master Microsoft platforms and prove their mettle in a competitive… Read More »

5 Easiest Ways to Get CRISC Certification

CRISC Certification – Steps to Triumph Are you ready to stand out in the ever-evolving fields of risk management and information security? Achieving a Certified in Risk and Information Systems Control (CRISC) certification is more than just adding a prestigious title next to your name — it’s a powerful statement about your expertise in safeguarding… Read More »

Complete VMware Certification Guide 2024

Hello, tech aficionados and IT wizards! Ever thought about propelling your career forward with a VMware certification? If you have, great – you’ve landed in the perfect spot. And if you haven’t, get ready to be captivated. VMware stands at the forefront of virtualization and cloud infrastructure globally, presenting a comprehensive certification program tailored to… Read More »

How Cisco CCNA Certification Can Boost Your IT Career?

Hello, fellow tech aficionados! Are you itching to climb the IT career ladder but find yourself at a bit of a standstill? Maybe it’s time to spice up your resume with some serious certification action. And what better way to do that than with the Cisco Certified Network Associate (CCNA) certification? This little gem is… Read More »

What You Need to Know to Become Certified Information Security Manager?

Curious about the path to Certified Information Security Manager? Imagine embarking on a journey where each step brings you closer to mastering the complex realm of information security management. Picture yourself wielding the prestigious Certified Information Security Manager (CISM) certification, a beacon of expertise administered by the esteemed Information Systems Audit and Control Association (ISACA).… Read More »

img