> For the complete documentation index, see [llms.txt](https://freundcloud.gitbook.io/devops-examples-from-real-life/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freundcloud.gitbook.io/devops-examples-from-real-life/cloud-platforms/aws/services/sqs.md).

# Amazon SQS (Simple Queue Service)

## Overview

Amazon SQS is a fully managed message queuing service for decoupling and scaling microservices, distributed systems, and serverless apps.

## Real-life Use Cases

* **Cloud Architect:** Design asynchronous workflows for order processing.
* **DevOps Engineer:** Buffer jobs for batch processing pipelines.

## Terraform Example

```hcl
resource "aws_sqs_queue" "job_queue" {
  name = "job-queue"
}
```

## AWS CLI Example

```sh
aws sqs create-queue --queue-name job-queue
```

## Best Practices

* Use dead-letter queues for failed messages.
* Set appropriate visibility timeouts.

## Common Pitfalls

* Not handling message duplication.
* Ignoring queue length metrics.

> **Joke:** Why did the SQS message get lost? It took the wrong queue!
