What is Amazon Simple Queue Service? - Amazon Simple Queue Service
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

如果我们为英文版本指南提供翻译,那么如果存在任何冲突,将以英文版本指南为准。在提供翻译时使用机器翻译。

What is Amazon Simple Queue Service?

Amazon Simple Queue Service (Amazon SQS) 提供安全、持久且可用的托管队列,可让您集成和分离分布式软件系统和组件。Amazon SQS 提供常见的构造,例如死信队列成本分配标签。它提供了一个通用 Web 服务 API,并且可通过 AWS 开发工具包支持的任何编程语言访问。

Amazon SQS 支持标准队列FIFO 队列。有关更多信息,请参阅What type of queue do I need?

What are the main benefits of Amazon SQS?

  • SecurityYou control who can send messages to and receive messages from an Amazon SQS queue.

    服务器端加密 (SSE) lets you transmit sensitive data by protecting the contents of messages in queues using keys managed in AWS Key Management Service (AWS KMS).

  • Durability – To ensure the safety of your messages, Amazon SQS stores them on multiple servers. Standard queues support at-least-once message delivery, and FIFO queues support exactly-once message processing.

  • Availability – Amazon SQS uses redundant infrastructure to provide highly-concurrent access to messages and high availability for producing and consuming messages.

  • Scalability – Amazon SQS can process each buffered request independently, scaling transparently to handle any load increases or spikes without any provisioning instructions.

  • Reliability – Amazon SQS locks your messages during processing, so that multiple producers can send and multiple consumers can receive messages at the same time.

  • Customization – Your queues don't have to be exactly alike—for example, you can set a default delay on a queue. You can store the contents of messages larger than 256 KB using Amazon Simple Storage Service (Amazon S3) or Amazon DynamoDB, with Amazon SQS holding a pointer to the Amazon S3 object, or you can split a large message into smaller messages.

How is Amazon SQS different from Amazon MQ or Amazon SNS?

Amazon SQS 和 Amazon SNS 是高度可扩展、易于使用且不需要您设置消息代理的队列和主题服务。我们建议对新的应用程序使用这些服务,这样可以实现几乎不受限制的可扩展性和简单 API。

Amazon MQ 是一项托管消息代理服务,可兼容许多常见消息代理。我们建议使用 Amazon MQ 从依赖与 API(如 JMS)或协议(如 AMQP、MQTT、OpenWire 和 STOMP)的兼容性的现有消息代理迁移应用程序。

What type of queue do I need?

标准队列 FIFO队列

Unlimited Throughput – 标准队列的每个 API 操作(SendMessageReceiveMessageDeleteMessage)每秒支持接近无限的 API 调用。

At-Least-Once Delivery – 至少发送一个消息,但偶尔会发送一个消息副本。

Best-Effort Ordering – 有时,邮件的交付顺序可能与发送的订单不同。

High Throughput – 如果您使用批处理,则 FIFO 队列的每个 API 方法(SendMessageBatchReceiveMessageDeleteMessageBatch)每秒最多支持 3000 个事务。3000 个事务代表 300 个 API 调用,每个调用带有包含 10 条消息的一个批处理。要申请提高配额,请提交支持请求。 在不使用批处理的情况下,FIFO 队列的每个 API 方法(SendMessageReceiveMessageDeleteMessage)每秒最多支持 300 个 API 调用。

Exactly-Once Processing – 一个消息一次交付一次,直到消费者处理并删除。不会将重复项引入到队列中。

First-In-First-Out Delivery – 严格保留消息发送和接收的顺序。

当吞吐量很重要时,请在应用程序之间发送数据,例如:

  • Decouple live user requests from intensive background work: let users upload media while resizing or encoding it.

  • Allocate tasks to multiple worker nodes: process a high number of credit card validation requests.

  • Batch messages for future processing: schedule multiple entries to be added to a database.

当事件的顺序重要时,请在应用程序之间发送数据,例如:

  • Ensure that user-entered commands are executed in the right order.

  • Display the correct product price by sending price modifications in the right order.

  • Prevent a student from enrolling in a course before registering for an account.

How can I get started with Amazon SQS?

We want to hear from you

我们欢迎您提供反馈!要与我们联系,请访问 Amazon SQS 开发论坛