AWAS Messaging
AWS Tutorial: Application Integration & Messaging
Welcome to the AWS Messaging lesson. When building large, cloud-native applications, you rarely build a single, massive program. Instead, you build many smaller independent services (microservices) that need to talk to each other to function as a whole.
Why Learn AWS Messaging?
Learning how to properly connect different parts of your application is essential for building resilient, highly scalable systems. Application integration services allow you to "decouple" your architecture, meaning if one part of your system fails or slows down, the rest of the system isn't dragged down with it.
Tutorial Overview
In this tutorial, you will learn:
- The critical difference between tightly coupled and loosely coupled architectures.
- How messaging services enable loose coupling.
- An introduction to the primary AWS messaging services available to you.
Tightly Coupled vs Loosely Coupled
- Tightly Coupled Architecture: If Service A sends a request directly to Service B, and Service B crashes due to an error, Service A might freeze or crash as well while it waits indefinitely for a response. They depend entirely on each other.
- Loosely Coupled Architecture: Service A sends a message to a reliable intermediary (like a cloud queue). Service B retrieves the message from the queue when it is ready. If Service B crashes, the messages safely wait in the queue until B comes back online. Service A is completely unaffected.
The Key AWS Messaging Services
AWS provides several highly scalable services to facilitate loose coupling:
- Amazon SQS (Simple Queue Service): A robust message queue service used to decouple applications. Messages are placed in a queue and processed by a consumer whenever it has availability.
- Amazon SNS (Simple Notification Service): A highly flexible publish/subscribe (pub/sub) service. A publisher sends a message to a centralized "topic," and multiple subscribers instantly receive a copy of that message.
- Amazon EventBridge: A serverless event bus that connects application data from your own custom apps, external SaaS products, and internal AWS services seamlessly.