Ep. 72 | Amazon SQS Overview & Exam Prep | App Integration | SAA-C03 | AWS Solutions Architect Associate

Chris 0:00
Welcome back, everybody. Today, we're going to be taking a deep dive into Amazon SQS. And you might be thinking, SQS. I already use that all the time, but stick with us, because even if you think you know SQS like the back of your hand, we're going to be uncovering some hidden gems and some really interesting, exam worthy insights when we really get into the details of this service. Yeah,

Kelly 0:21
that's right. SQS might seem simple at first, but it's really the foundation for so many robust and scalable systems. And today we're gonna go beyond the basics and really look at how mastering SQS can help you level up your cloud skills. Before

Chris 0:35
we get into all the cool, advanced stuff, let's do a real quick overview for anyone who might be new to this. What exactly is Amazon SQS, and why should we care about it? Well,

Kelly 0:44
at its core, Amazon SQS is a fully managed message queuing service, and what that means is that it acts as a middleman between different parts of your application so they can communicate with each other, even if those parts aren't running at the same time or maybe don't have a direct connection. So it's kind of like

Chris 0:58
leaving a note for someone. If you can't talk to them directly. You can write down what you need, and they can check it later when they're available. Yeah, that's

Kelly 1:04
a great analogy, and just like leaving a note ensures that they get the message, SQS make sure that your applications can send messages reliably without having to worry about things like network issues or one part being down temporarily.

Chris 1:18
Got it. So it's all about making sure that those messages don't get lost, even in a really complicated system. Can you give us a few real world examples of how people use SQS?

Kelly 1:29
Absolutely. One common use case is for like, order processing for an E commerce platform. So let's say you have 1000s of customers placing orders on your website. Maybe it's a big sale or something, and there's a lot of traffic, using SQS lets you separate that order placement system from the inventory management and shipping systems.

Chris 1:47
Oh, I see. So the order placement system can just put those orders into an SQS queue without having to wait for a confirmation that each one has been processed. Exactly

Kelly 1:56
that way, your website can handle that huge spike in traffic without slowing down. And at the same time, your inventory and shipping systems can pull orders from that queue at a pace that they can handle that makes sure that things are processed smoothly, even when things are really busy.

Chris 2:11
That makes sense. It's like a buffer that prevents everything from crashing when the website gets slammed. Are there any other situations where SQS comes in handy? Definitely.

Kelly 2:19
Another good example is when you need to process a lot of data from things like social media feeds or maybe even devices and sensors from the internet of things. So you can use SQS to kind of buffer and distribute that data to your processing systems, which lets your systems scale up and analyze that information efficiently without getting overwhelmed. So

Chris 2:39
if I was building an application that analyzes what people are saying about a company on Twitter. I could use SQS to handle all those tweets and distribute them to my analysis tools. Exactly.

Kelly 2:48
SQS helps break down that big task into smaller parts, which makes your system much more robust and scalable.

Chris 2:55
Okay, I see why people use this so much. It's like the Swiss Army knife of Cloud Messaging, but I know there's more to SQS than just sending messages around. Let's dig a little deeper into some of the features and functions that make it so powerful.

Kelly 3:08
Yeah, let's do it, and while we explore those features, we'll also see how the simple service plays a bigger role in the entire AWS ecosystem. Sounds

Chris 3:16
good to me. I'm ready to get into the nuts and bolts of

Kelly 3:19
SQS. So welcome back to our deep dive into Amazon SQS. All

Chris 3:23
right, so we've talked about what SQS is and some real world examples. Now I'm ready to get into the nuts and bolts. What are some of the key features that make SQS really powerful?

Kelly 3:34
One of the first things you'll come across when you start working with SQS is the different types of queues that are available. There are two main ones, standard queues and FIFO queues. You

Chris 3:44
know, I always get those two mixed up. It seems like a subtle difference, but I know it could have a big impact on how things work. Could you break those down? For me,

Kelly 3:51
absolutely. It really depends on how important order is in your application. So think about it this way. Imagine you're building a system to handle bank transactions. What if a deposit was processed before a withdrawal? Oh,

Chris 4:04
man, that would be a disaster. You can end up with negative balances and a lot of unhappy customers exactly.

Kelly 4:09
You can't have that happen in that kind of situation. Every single message has to be processed in the exact order it was sent. That's where FIFO queues come in. FIFA stands for First In, First Out, and that guarantees that the messages are processed in the exact sequence they were added to the queue. So it ensures data integrity for critical things like financial transactions. Okay,

Chris 4:31
that makes sense. So FIFA is like a single file line at the bank where nobody can cut but what about those times when the order isn't so critical, right?

Kelly 4:38
Think of something like processing social media posts. Does it really matter if one post is analyzed a few seconds before another? Probably not. That's when you would use a standard queue. It prioritizes speed and throughput, so it handles messages as quickly as possible without guaranteeing that strict order. So it's

Chris 4:54
like a multi lane highway where messages can zip around and get where they need to go quickly. Even if they don't arrive in perfect order. Yeah, exactly.

Kelly 5:01
And both types of queues have their own strength and are meant for different situations. But going beyond just the queue types, SQS offers a bunch of features that make it really flexible,

Chris 5:12
like what Tell me more, well, security is

Kelly 5:15
a big one. SQS is built with security in mind. From the ground up, you can control access to your queues using IAM, that's AWS identity and access management, which means that only authorized users and applications can send or receive messages. Yeah,

Chris 5:29
security is so important these days, it's good to know that SQS has that covered. What about integrating SQS with other AWS services?

Kelly 5:37
Oh, SQS plays well with a whole bunch of other AWS services. You can trigger Lambda functions to process messages as they come into a queue, which is really powerful for serverless architectures. We

Chris 5:48
talked about that a little bit earlier with those real world examples. It seems like SQS is the glue that holds a lot of these serverless applications together.

Kelly 5:56
It really is. And you can also use SQS with things like Amazon, SNS for fan up messaging, Amazon, Kinesis for streaming data, even EC2 instances for more traditional setups. Wow,

Chris 6:07
so many possibilities. But I know that every service has its limitations. What are some things we need to watch out for when we're working with SQS?

Kelly 6:15
That's a really good point. One thing to remember is that SQS messages have a size limit. Each message can only be up to 256, KDB in size.

Chris 6:23
Okay, so what happens if you need to send something bigger than that, like a huge file or a complex data structure? Well,

Kelly 6:29
there are a couple of ways to get around that. One option is to break down the big message into smaller chunks and send them separately. Then you can reassemble them on the other end. Oh, I

Chris 6:38
see. So like setting a puzzle piece by piece Exactly. Another

Kelly 6:41
option is to use SQS along with Amazon S3 so you could upload that big file to S3 and then send a message through SQS with a link to the file. Ah,

Chris 6:51
that's smart. So instead of trying to squeeze the whole file through SQS, you just send directions to where it is, right.

Kelly 6:56
And by using S3 you get all the benefits of its scalability and durability for storing those larger files.

Chris 7:03
So even with these limitations, there are ways to use SQS for all kinds of scenarios.

Kelly 7:07
Definitely understanding those little details is what separates the good cloud engineers from the great ones. And speaking of being a great cloud engineer, let's move on to something I know you've been excited about, exam prep. All

Chris 7:20
right, let's do it. Hit me with those SQS brain teasers. Okay, let's get into some of those exam style questions, the kind of questions that could really trip you up if you're not careful.

Kelly 7:30
Sounds good to me. I'm ready for the challenge. All

Chris 7:32
right, here we go. Let's say you're designing a system to handle orders for like an online store. Each order needs to be processed in the exact order it was received to make sure that the inventory is managed correctly and things are shipped out in the right order. Which type of SQS queue would you choose for that and why? Ah,

Kelly 7:50
this is a perfect example of where the order of those messages is absolutely critical. If you process an order for a product before an earlier order for that same product is finished, you could end up overselling that item and having to tell a customer that you can't actually fulfill their order. So in this scenario, you would absolutely need to use a FIFO queue that guarantees that the messages are processed in that exact order, preventing those inventory mistakes and keeping your customers happy. That

Chris 8:16
makes perfect sense. FIFO is the way to go when you absolutely need to maintain that order of operations. All right, let's try another one. You're working with a system that's getting a ton of data from a lot of different places, like social media feeds and sensors, from all those Internet of Things devices you need to process and analyze all that data in real time. How could you use SQS to help with that?

Kelly 8:37
That's a great question. This is where the ability of SQS to separate those different parts of your system and to scale up really comes into play. Just imagine all those data streams coming in like fire hoses just blasting information at your system. You wouldn't want to point those fire hoses directly at your processing applications.

Chris 8:55
Would you no way that would be way too much to handle all at once. Right? Exactly.

Kelly 9:00
So what you can do is use SQS as a buffer. So instead of having those fire hoses aimed directly at your applications, you can have them feed into those SQS queues. Then your different applications can pull messages from those queues at a pace that they can handle. So

Chris 9:14
it's like SQS is acting like a pressure valve, smoothing out that flow of data and making sure that nothing gets overloaded precisely,

Kelly 9:21
and as the amount of data coming in increases, you can easily scale those SQS queues and your application separately, which gives you a lot of flexibility to handle those really demanding situations. That's

Chris 9:32
the power of the cloud right there, being able to scale things up or down as needed. Okay, last question, what if you needed to design a system that automatically backs up your important data to a separate region, just in case something goes wrong. How could you use SQS to set up something like that? Ah,

Kelly 9:49
that's a really interesting one. It shows how you can use SQS for more than just messaging between applications. In this situation, you could use SQS to create a really reliable. Replication pipeline. Okay, I'm listening. So what you do is have your main system send messages that contain the data to an SQS queue in your primary region. Got

Chris 10:09
it so the important data is flowing into that SQS queue. What happens next? Well,

Kelly 10:13
from there, you can set up another process that pulls those messages from that queue and replicates them to a different SQS queue, but the second queue would be in your backup region. This replication can happen in the background, so even if your primary region has an outage, you'll still have a copy of your data safe and sound in that backup region. So

Chris 10:31
it's like having a constant stream of data flowing to that backup location, just in case something goes wrong in your main environment,

Kelly 10:37
exactly. And on top of that, you can even use the dead letter Q feature of SQS to catch any messages that weren't replicated properly, which means you can troubleshoot and fix any issues without losing that important data.

Chris 10:50
Wow, I'm starting to see how SQS can be used to build some pretty amazing systems, and that's

Kelly 10:56
just scratching the surface. There are even more advanced features and use cases out there, things that we didn't have time to get to today. That's

Chris 11:03
why we call it the deep dive. I feel like we've gone way deeper into SQS than I ever have before. Any final words of advice for our listeners as they continue on their cloud journeys.

Kelly 11:13
The biggest thing is to stay curious. Don't be afraid to dive into the AWS documentation. See how other people are using SQS, and try building your own solutions. The more you learn about the service, the better prepared you'll be to tackle any challenge that comes your way.

Chris 11:28
I love that advice. Thanks for joining us for this deep dive into Amazon SQS. We hope you learned something new and valuable today, something that will help you level up your cloud skills until

Kelly 11:39
next time, keep those cues flowing and your cloud career soaring, we'll

Chris 11:43
see you all in the cloud. You.

Ep. 72 | Amazon SQS Overview & Exam Prep | App Integration | SAA-C03 | AWS Solutions Architect Associate
Broadcast by