# What is Queues?

Queues holds messages between the part of an application that produces work and the part that does it, with the names and behaviour of Amazon SQS.

A web request puts "send the invoice for order 42" on a queue and returns; a worker receives the
message when it has time, does the work and deletes the message. If the worker is down, the
messages wait. You find queues under **Queues** in the Deutsche Cloud Console.

## When to use it

- One part of an application should not wait for another, or should keep working while the other
  is down.
- Work arrives in bursts and the consumers should take it at their own pace.
- You have code written for Amazon SQS: the SQS endpoint speaks SQS's JSON protocol, so AWS SDK
  and AWS CLI releases that use that protocol (from November 2023 on) work unchanged. Older
  releases, which use the XML query protocol, are refused (see
  [Use an SQS client](use-an-sqs-client.md)).

## Concepts

| Term                   | Meaning                                                                                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Standard queue**     | At-least-once delivery in best-effort order. See [Message delivery](message-delivery.md).                                                                                  |
| **FIFO queue**         | Each message group is delivered in the order it was sent, and a repeated send within five minutes is dropped. Its name ends in `.fifo`. See [FIFO queues](fifo-queues.md). |
| **Visibility timeout** | How long a received message stays hidden from other consumers. Delete it before then, or it is delivered again.                                                            |
| **Receipt handle**     | What a receive hands you with each message; you delete or extend the message with it.                                                                                      |
| **Long polling**       | A receive that waits up to 20 seconds for a message instead of answering empty at once.                                                                                    |
| **Dead-letter queue**  | Another queue that takes a message after it has been received a set number of times without being deleted. See [Dead-letter queues](dead-letter-queues.md).                |
| **Redrive**            | Moving a dead-letter queue's messages back to the queues they failed in.                                                                                                   |

Queues are named, not numbered: a queue's name is unique in its organization and region, and the
API, the CLI and the SQS endpoint all address a queue by its name.

## Pricing

- **Requests**: €0.30 per million. Every call to the queue API or the SQS endpoint is one request,
  including the calls the console makes; a batch of ten messages is one request, and so is a long
  poll however long it waits.
- **Stored messages**: €0.10 per GB-month, measured daily over the messages held in all your
  queues.

## Interfaces

- The Deutsche Cloud Console, under **Queues**.
- The CLI: `dcloud queue …`; see the _CLI Command Reference_.
- The HTTP API under `/queue/api`; see the _API Reference_.
- Terraform: `dcloud_queue`.
- The SQS endpoint, for the AWS SDKs, boto3 and the AWS CLI.

## Next steps

- [Get started](getting-started.md): create a queue, send and receive a message, and clean up.
- [Create a queue](create-a-queue.md)
- [Use an SQS client](use-an-sqs-client.md)
