CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Amazon SQS — Managed Message Queuing Service
Amazon SQS is a fully managed message queuing service that enables decoupling and scaling of microservices, distributed systems, and serverless applications.
What it is
- A fully managed message queuing service that enables asynchronous communication between distributed components.
- Supports both standard queues (at least once delivery) and FIFO queues (exactly once processing).
When I reach for it
- When you need to decouple application components to improve reliability and scalability.
- In scenarios where you need to buffer requests between producers and consumers, managing spikes in workloads.
Key architectural decisions
- Choose between Standard and FIFO queues based on the need for message ordering and exactly-once delivery.
- Consider visibility timeout settings to manage message processing failures effectively.
- Decide on dead-letter queues (DLQs) for handling message processing failures and retries.
- Evaluate message retention period (1 minute to 14 days) based on application needs.
Gotchas & exam traps
- Remember that FIFO queues have a maximum message group ID limit of 300; this can affect design.
- Standard queues do not guarantee message order, which may lead to unexpected behavior if not accounted for.
- Be cautious with visibility timeouts; if not set correctly, messages can be reprocessed or lost.
The architect view
- SQS is essential for building resilient applications that can handle varying loads and maintain separation of concerns.
- Use it in designs where components need to operate independently, allowing for easier scaling and fault tolerance.