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

3 Real-World Tasks You’ll Tackle in Google Data Analytics Certification

Introduction In today’s fast-paced digital world, certifications are essential for professionals aiming to showcase their expertise and progress in their careers. Google’s certifications, especially in data analytics, are highly regarded for their emphasis on practical, job-ready skills. The Google Data Analytics Certification, known for its broad skill development in data processing, analysis, and visualization, stands… Read More »

Cisco Networking Academy

Introduction Cisco Networking Academy is a comprehensive e-learning program that provides students with the foundational information technology (IT) skills needed to design, build, and manage networks, along with career skills such as problem-solving, collaboration, and critical thinking. Launched in 1997 by Cisco Systems, the program has become a global education initiative that offers a wide… Read More »

Cisco Certification Trends in 2024

Introduction Cisco certifications are widely acknowledged as the gold standard in the IT industry, demonstrating a professional’s expertise across a diverse range of networking domains. These credentials span several levels of expertise: Entry, Associate, Professional, and Expert, with each professional-level exam additionally conferring a Specialist certification. This structure allows professionals to demonstrate their knowledge progression,… Read More »

5 Jobs You Can Get with CompTIA Security+ Certification

Introduction Amid the digital revolution, IT professionals are leveraging CompTIA certifications as crucial instruments to highlight their skills and propel their careers forward. These credentials, highly esteemed in the IT industry, offer a structured pathway through five distinct levels: Core, Infrastructure, Cybersecurity, Data and Analytics, and Additional Professional certifications. Designed to furnish IT professionals with… Read More »

CompTIA Certifications Worth to Earn in 2024

Introduction In an era defined by rapid technological advancement and digital transformation, the importance of skilled IT professionals has never been greater. As businesses strive to adapt to evolving technologies and secure their digital assets, the demand for individuals with industry-recognized certifications continues to soar. Among the most respected and sought-after credentials in the IT… Read More »

The Admiral in Asheville, N.C. #1 Food Restaurant Review

The Admiral: A Global Culinary Adventure in Asheville, NC Nestled in Asheville’s vibrant core, The Admiral isn’t your average restaurant. Housed in a humble cinder-block building, it boasts a reputation for innovative global cuisine, a lively atmosphere, and a commitment to fresh, seasonal ingredients. Whether you’re a seasoned foodie or a curious tourist, The Admiral… Read More »

img