それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

AmazonSQSについて

AmaoznSQSのページを日本語訳しておいた。

サービスの概要

Amazon SQS Functionality
AmazonSQSの機能
Developers can create an unlimited number of Amazon SQS queues, each of which can send and receive an unlimited number of messages.
待ちキュー行列をいくつでもに作ることが出来る。またそれぞれの待ちキューへはメッセージという単位でデータを送受信でき個数は無制限である。
New messages can be added to a queue at any time. The message body can contain up to 8 KB of text in any format.
いつでも待ちキューへのメッセージ登録を行える。メッセージは8KB未満のテキストで定義されている。
A computer can check a queue at any time for messages waiting to be read.
端末は、いつでも処理待ちキューをチェックすることが出来る。
A message is “locked” while a computer is processing it, keeping other computers from trying to process it simultaneously. If processing fails, the lock will expire and the message will again be available.
端末が処理中はメッセージを【ロック】することが出来る。ロックすることで他のコンピュータが重複して同じ処理をしないよういする。これにより分散処理を速やかに行える。端末の処理失敗などで、長時間にわたり結果が送信されないとき、ロックは有効期限切れとなり再び【処理待ち】としてアンロックされる。
Messages can be retained in queues for up to 4 days.
メッセージは4日間保存され、アクセスが可能である。
Developers can access Amazon SQS through standards-based SOAP and Query interfaces designed to work with any Internet-development toolkit.
AmazonSQSへはSOAPベースのAPIを使ってアクセスするが、AmazonSQSライブラリを使って作業をすることができる。

サービスの特徴

Service Highlights
サービスの特徴

Amazon SQS provides significant advantages over the complexity of home-grown messaging systems or the ongoing expense of licensed or hosted systems.

AmazonSQSは次のようなケースにとても便利です。
独自APIなどで複雑化してしまったシステム、構築導入ではなく運用・データ量実績ベースの支払い体系、そして複数サービスをホスティングする場合などです。

Reliable – Amazon SQS runs within Amazon’s high-availability data centers, so queues will be available whenever applications need them. To prevent messages from being lost or becoming unavailable, all messages are stored redundantly across multiple servers and data centers.

高可用性。AmazonSQSはAmazon.COMのデータセンタ内部にあるため、Amazon.COMと同レベルの高可用性が実現された。アプリケーションのデータ要求に即応することができます。メッセージの損失に備えて、メッセージをデータセンタ内部で複数に分割して保存、またメッセージ複製を複数作成しています。

Simple – Developers can utilize Amazon SQS queues by using only four APIs: CreateQueue, SendMessage, ReceiveMessage, and DeleteMessage. The SOAP and query APIs can be used with virtually any language and platform.

シンプル。

AmazonSQS利用はシンプルです。最小限の4つのAPIで利用可能です。【CreateQueue】【SendMessage】【RecieveMessage】【DeleteMessage】の四つです。SOAPとHTTPのクエリベースの両方で利用可能で、いくつものプログラミング言語で透過的に扱うことができます。

Scalable – Amazon SQS was designed to enable an unlimited number of computers to read and write an unlimited number of messages at any time.

高拡張性 AmazonSQSは利用端末数が増えても問題なくメッセージを読み書き出来、件数も無制限でいつでもアクセス可能です。

Secure – Authentication mechanisms are provided to ensure that messages stored in Amazon SQS queues are secured against unauthorized access.

高機密性
 認証機能が提供されていて、AmazonSQSに保存されたメッセージにアクセス認証を行うことで、無断アクセスを遮断することができます。

Inexpensive – No up-front or fixed expenses. The only costs of sending messages through Amazon SQS are small per-request handling fees and data transfer fees. For $1 a user can transmit over a half a million (500,000) messages.


低価格

 初期費用、月額費用が無料。利用量に応じた課金がされます。データ転送量とリクエスト件数に応じた費用体系になっています。わずか$1で、約50万件を転送できます。
 

AmazonSQSの紹介文

Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different tasks, without losing messages or requiring each component to be always available. Amazon SQS makes it easy to build an automated workflow, working in close conjunction with the Amazon Elastic Compute Cloud (Amazon EC2) and the other AWS infrastructure web services.

Amazon Simple Queue Service (Amazon SQS)は高信頼性と高可用性を兼ね揃えたキューを提供します。
キューは複数コンピュータ間を行き来するメッセージを保存するのに使われます。AmazonSQSを使うことで、プログラマは簡単に重い処理をそれ専用のコンピューターに分散処理することが可能になり、その際にメッセージの消失や上書き防止対策などを考えなくて済むようになります。AmazonSQSの作業手順はとても簡単に定義されています、そしてAmazonEC2のコンピューター群と緊密な連携が可能になっています。

Amazon SQS works by exposing Amazon’s web-scale messaging infrastructure as a web service. Any computer on the Internet can add or read messages without any installed software or special firewall configurations. Components of applications using Amazon SQS can run independently, and do not need to be on the same network, developed with the same technologies, or running at the same time.

Amazon SQSは Amazonの巨大スケールなWebを支えるインフラをWebサービス化したものです。インターネット上のどこからでもキューにメッセージを追加することが出来ます。HTTPSベースなのでサービス固有のプログラムを必要としません。またファイアウォールの設定も気にせず利用できます。AmazonSQSを利用したアプリケーションはAmazonSQSとの依存関係を持たずに、アプリ毎の作業に特化することが出来ます。また同一ネットワークセグメントにPCが存在する必要もなく、同時に開発する必要もなく、バージョン差異を気にせずともよく、同時に起動している必要もなく、快適に開発をすることができます。

他のAmazonのWebServiceと連携

Using Amazon SQS with Other AWS Infrastructure Web Services

AmazonSQSを他のAmazonのAWSインフラと一緒に使う。

Amazon SQS can be used with Amazon EC2, as well as Amazon S3 and Amazon SimpleDB, to make applications more flexible and scalable. A common use case is to create an integrated and automated workflow, where multiple components or modules need to communicate with each other, but can’t all process the same amount of work simultaneously. In this case, SQS queues carry messages to be processed in an orderly fashion by the user’s application running on Amazon EC2 instances. The Amazon EC2 instances can read the queue, process the job, and then post the results as messages to another SQS queue (possibly for further processing by another application). Because Amazon EC2 allows applications to scale up and down dynamically, application developers can easily vary the number of compute instances based on the amount of work in the SQS queues, to ensure that jobs are executed in a timely manner.

AmazonSQSははAmazonEC2と連携することができます。もちろんAmazonS3やAmazonSimpleDBとも連携出来て、アプリケーションを柔軟に拡張性をもたせることができます。わかりやすい利用例としては、自動化された処理フローを分散処理サーバーに任せる用な使い方です。SQSはAmazonEC2インスタンスのアプリケーション毎に処理量が違う時などに便利です。アプリケーションごとに適切にメッセージを配分することが可能になります。EC2のインスタンスはキューを読み込み、ジョブを処理し結果を別キューに送信します。(以降は別のEC2インスタンスに処理が任されます。)EC2のインスタンスはジョブ量に応じて任意に動的に拡張が可能なので、EC2インスタンス量を制御してSQSにたまったキューをどんどん処理できます。これによりジョブを時間内に確実に終えることができます。

For example, here is how a video transcoding website uses Amazon EC2, Amazon SQS, Amazon S3, and Amazon SimpleDB together. End users submit videos to be transcoded to the website. The videos are stored in Amazon S3, and a message (“the request message”) is placed in an Amazon SQS queue (“the incoming queue”) with a pointer to the video and to the target video format in the message. The transcoding engine, running on a set of Amazon EC2 instances, reads the request message from the incoming queue, retrieves the video from Amazon S3 using the pointer, and transcodes the video into the target format. The converted video is put back into Amazon S3 and another message (“the response message”) is placed in another Amazon SQS queue (“the outgoing queue”) with a pointer to the converted video. At the same time, metadata about the video (e.g., format, date created and length) can be indexed into Amazon SimpleDB for easy querying. During this whole workflow, a dedicated Amazon EC2 instance can constantly monitor the incoming queue and, based on the number of messages in the incoming queue, is able to dynamically adjust the number of transcoding Amazon EC2 instances to meet customers’ response time requirements.

たとえば、ビデオのエンコードと転送のウェブサイト構築では、AmazonEC2、SQS,S3,SimpleDBを組み合わせて実現が可能です。
・・・