- Sending and receiving SQS messages
- Differences between SNS and SQS
- Registering subscribers of SNS topics
- Tracking state within your app with SWF
- Creating a SWF workflow
Skill Level Advanced
- As an application grows larger, and larger, it can be really difficult to add on new components, and then sometimes users just get lost in the system. Like, a user who was supposed to get an order shipped to them never got a tracking number, and it looked like the warehouse never received the order, but your payment gateway charged them for the items. Whoops. But you've got 30 orders today, and they all went through just fine, so what happened with this one angry customer? Why did the system let us down, and will it happen again? To fix issues like this, it can help to take your large application and break it down into smaller components, such as a component that handles billing, and another component that handles inventory, and another that handles shipping orders. By using a messaging service, you can have these components send messages to each other when a new order needs to be shipped, and a workflow framework can make sure you retry a failed credit card charge the next day before canceling an order. Amazon has three services that can help coordinate messages between these components, and when used together, they can breakdown a complicated workflow. Simple Queue Service, or SQS, can create work queues within your system, so slow bits of code can have several workers that are working on results for a queue of users, and make sure that a task never gets forgotten about. Simple Notification Service, or SNS, can announce events as they occur in your system. So every time a new order is created, SNS can shout to the room, "We've got a new order," and workers can take immediate actions. Simple Workflow Service, or SWF, can help coordinate complicated workflows, like an order processing workflow, to make sure that each step happens in sequence, and lets you know when an order is stuck in the system before the customer calls to tell you about it. My name is JV and I've been working with web applications and servers for over 20 years, and I've created my fair share of applications that have gotten too large, and too hard to maintain. Using modern messaging services, we can make sure that the app stays lean and modular, regardless of how large or complex your workflow is.