Chapter 8: SQS, SWF, and SNS

Chapter 8: SQS, SWF, and SNS

  1. D. Amazon DynamoDB is not a supported Amazon SNS protocol.
  • SNS的訂閱者(即 Web 服務器、電子郵件地址、Amazon SQS 隊列、AWS Lambda 函數)在其訂閱主題后通過受支持協議(即 Amazon SQS、HTTP/S、電子郵件、SMS、Lambda)中的一種使用或接收消息或通知。
  1. A. When you create a new Amazon SNS topic, an Amazon ARN is created automatically.
  • 創建SNS topic的輸出交付物就是ARN,供訂閱提醒的時候填寫;
  1. A, C, D. Publishers, subscribers, and topics are the correct answers. You have subscribers to an Amazon SNS topic, not readers.
  • SNS的特性主要是創建topic,然后創建訂閱者來訂閱。通過publish發布提醒;
  1. A. The default time for an Amazon SQS visibility timeout is 30 seconds.
  • SQS的默認 visibility time是30S(0-12小時)
  • SQS的默認 消息保留周期4天(1分鐘-14天)
  • SQS的最大消息 256K(1k-256k之間)
  • SQS的默認交付延遲時間0s(0-15分鐘)
  • SQS的默認 接收消息等待時間0s(0-20s)
  • SQS的死信隊列最大接收次數1-1000之間
  • SQS支持SSE、CMK進行加密
  1. D. The maximum time for an Amazon SQS visibility timeout is 12 hours.
  2. B, D. The valid properties of an SQS message are Message ID and Body. Each message receives a system-assigned Message ID that Amazon SQS returns to you in the SendMessage response. The Message Body is composed of name/value pairs and the unstructured, uninterpreted content.
  • SQS的message的有效屬性就是 messageid和body,這個和普通的MQ server(如activemq)的消息沒啥區別;
  1. B. Use a single domain with multiple workflows. Workflows within separate domains cannot interact.
  • 使用AWS的工作流的時候都需要先創建domain,在同一個domain下的工作流可以交互,跨domain的工作流無法交互;
  1. A, B, C. In Amazon SWF, actors can be activity workers, workflow starters, or deciders.
  • Amazon SWF 在其運行過程中,會與很多不同類型的程序參與者actor 交互。參與者可以是 [工作流程啟動程序]、[決策程序]或[活動工作程序]
  1. B. Amazon SWF would best serve your purpose in this scenario because it helps developers build, run, and scale background jobs that have parallel or sequential steps. You can think of Amazon SWF as a fully-managed state tracker and task coordinator in the Cloud.
  • SWF 可以滿足這種并行或者順序執行的場景。Amazon Simple Workflow Service (Amazon SWF) 提供編程模型和基礎設施來協作分布式組件并采用可靠方法來維護其執行狀態,可使分布式異步應用程序的開發更簡單。借助 Amazon SWF,您可以自由關注與其有區別的應用程序方面的構建。
  1. D. Amazon SQS does not guarantee in what order your messages will be delivered.
  • SQS提供的主要是異步響應能力,因為是集群方式接收消息,所以無法保證消息的順序性;
  1. A. Multiple queues can subscribe to an Amazon SNS topic, which can enable parallel asynchronous processing.
  • 多個SQS隊列是可以訂閱一個SNS topic的
  1. D. Long polling allows your application to poll the queue, and, if nothing is there, Amazon Elastic Compute Cloud (Amazon EC2) waits for an amount of time you specify (between 1 and 20 seconds). If a message arrives in that time, it is delivered to your application as soon as possible. If a message does not arrive in that time, you need to execute the ReceiveMessage function again.
  • 為了降低調用SQS的成本,需要設置長輪詢(long polling)的等待時間來降低訪問頻次,進而降低調用成本,默認是0,可以設置成0-20s之間
  1. B. The maximum time for an Amazon SQS long polling timeout is 20 seconds.
  • SQS的長輪詢最大時間是20S
  1. D. The longest configurable message retention period for Amazon SQS is 14 days.
  • SQS消息的最長保留時間是14天
  1. B. The default message retention period that can be set in Amazon SQS is four days.
  • SQS消息默認保留時間是4天
  1. D. With Amazon SNS, you send individual or multiple messages to large numbers of recipients using publisher and subscriber client types.
  • SNS的客戶端有publisher和subscriber
  • SQS的客戶端應該是producer和consumer
  1. B. The decider schedules the activity tasks and provides input data to the activity workers. The decider also processes events that arrive while the workflow is in progress and closes the workflow when the objective has been completed.
  • decider定義了活動的執行路徑。決策程序是工作流程寫作邏輯的執行。決策程序控制工作流程執行中的活動任務流程。只要工作流程執行過程中發生更改 (如任務完成),都會向決策程序傳遞包含整個工作流程歷史記錄的決策任務。當決策程序從 Amazon SWF 接收決策任務時,它會分析工作流程執行歷史,以確定工作流程執行中接下來的相應步驟。決策程序會使用決策 將上述步驟反饋給 Amazon SWF。
  1. C. Topic names should typically be available for reuse approximately 30–60 seconds after the previous topic with the same name has been deleted. The exact time will depend on the number of subscriptions active on the topic; topics with a few subscribers will be available instantly for reuse, while topics with larger subscriber lists may take longer.
  • SNS的topic刪除后30-60S內就可以重新使用了,可用時間取決于訂閱者,因為訂閱者也要被刪除掉;
  1. C. The main difference between Amazon SQS policies and IAM policies is that an Amazon SQS policy enables you to grant a different AWS account permission to your Amazon SQS queues, but an IAM policy does not.
  • SQS policy與IAM policies最大的不同是,SQS policy允許你給不同的AWS賬戶授權你的SQS隊列。
  1. C. No. After a message has been successfully published to a topic, it cannot be recalled.
  • 當一個消息被成功的發布到SNS的topic上,是沒法被重新調用了,被訂閱取走;

知識點總結

  • Know how to use Amazon SQS. Amazon SQS is a unique service designed by Amazon to help you to decouple your infrastructure. Using Amazon SQS, you can store messages on reliable and scalable infrastructure as they travel between your servers. This allows you to move data between distributed components of your applications that perform different tasks without losing messages or requiring each component always to be available.

  • 了解如何去使用SQS。SQS是AWS唯一的一個用來進行架構解耦的服務。使用SQS你能將消息以可信可擴展的方式在不同server之間傳遞。這個允許你將數據在不同的應用組件間執行不同的任務,同時保證消息不丟失,進而保證每個組件可用。

  • Understand Amazon SQS visibility timeouts. Visibility timeout is a period of time during which Amazon SQS prevents other components from receiving and processing a message because another component is already processing it. By default, the message visibility timeout is set to 30 seconds, and the maximum that it can be is 12 hours.

  • 理解SQS的visibility timeouts。這個是一個阻止其他組件接收處理消息的設置,被用于消息已經被另一個組件處理的場景。message的visibility的默認值是30秒,最大值是12小時。

  • Know how to use Amazon SQS long polling. Long polling allows your Amazon SQS client to poll an Amazon SQS queue. If nothing is there, ReceiveMessage waits between 1 and 20 seconds. If a message arrives in that time, it is returned to the caller as soon as possible. If a message does not arrive in that time, you need to execute the ReceiveMessage function again. This helps you avoid polling in tight loops and prevents you from burning through CPU cycles, keeping costs low.

  • 了解SQS的long polling。Long polling允許你從SQS的客戶端去拉取SQS queue.如果沒有消息,ReceiveMessage 將會等待1-20秒。如果消息到達,他就會立即進行調用。如果一個消息沒有到達,你需要在等待結束后重新調用ReceiveMessage。這樣幫助你輕量級的進行輪詢,防止你消耗CPU,降低了成本;

  • Know how to use Amazon SWF. Amazon SWF allows you to make applications that coordinate work across distributed components. Amazon SWF is driven by tasks, which are logical units of work that part of your application performs. To manage tasks across your application, you need to be aware of inter-task dependencies, scheduling of tasks, and using tasks concurrently. This is where Amazon SWF can help you. It gives you full control over implementing tasks and coordinating them without worrying about underlying complexities such as tracking their progress and maintaining their state.

  • 了解如何使用SWF。SWF允許你將因公在不同的分布式組件之間寫作。SWF被任務驅動,這個是你應用的邏輯工作單元。為了管理跨應用的任務,你需要了解任務的依賴關系,定時任務以及并行任務。SWF可以覆蓋如上場景。SWF讓你可以完全控制實現任務的交互,而不用擔心邏輯的復雜度,例如跟蹤流程及維護狀態等。

  • Know the basics of an Amazon SWF workflow. A workflow is a collection of activities (coordinated by logic) that carry out a specific goal. For example, a workflow receives a customer order and takes whatever actions are necessary to fulfill it. Each workflow runs in an AWS resource called a domain, which controls the scope of the workflow. An AWS account can have multiple domains, each of which can contain multiple workflows, but workflows in different domains cannot interact.

  • 了解SWF工作流的基本信息。一個工作是一系列有邏輯寫作的任務組成,為了完成一個特定的目標。例如,一個工作流接收客戶訂單和任務,當動作需要的時候。每個工作流都在AWS的domain中運行,這個是工作流的邊界。一個AWS賬戶可以有多個domain,每個可以包含多個工作流。但是在不同domain下的工作流是不能交互的。

  • Understand the different Amazon SWF actors. Amazon SWF interacts with a number of different types of programmatic actors. Actors can be activity workers, workflow starters, or deciders.
    -理解SWF的actors的不同。Amazon的SWF不同類型的程序類型交互。actors可以是activity workers,workflow starters或者deciders。

  • Understand Amazon SNS basics. Amazon SNS is a push notification service that lets you send individual or multiple messages to large numbers of recipients. Amazon SNS consists of two types of clients: publishers and subscribers (sometimes known as producers and consumers). Publishers communicate to subscribers asynchronously by sending a message to a topic.

  • 理解SNS的基本知識。Amazon SNS是一個推送消息的服務,允許你將個人或者多個消息推送到大量的接收者。Amazon SNS由兩種類型的客戶端組成。發布者和訂閱者,也可以稱作生產者和消費者。發布者與訂閱者通過一個topic進行異步消息發送。

  • Know the different protocols used with Amazon SNS. You can use the following protocols with Amazon SNS: HTTP, HTTPS, SMS, email, email-JSON, Amazon SQS, and AWS Lambda.

  • 了解SNS的不同協議,你可以使用HTTP,HTTPS,SMS,EMAIL,EMAIL-JSON,SQS,Lambda進行消息傳遞。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,836評論 6 540
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,275評論 3 428
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事?!?“怎么了?”我有些...
    開封第一講書人閱讀 177,904評論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,633評論 1 317
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,368評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,736評論 1 328
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,740評論 3 446
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,919評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,481評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,235評論 3 358
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,427評論 1 374
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,968評論 5 363
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,656評論 3 348
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,055評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,348評論 1 294
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,160評論 3 398
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,380評論 2 379

推薦閱讀更多精彩內容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,757評論 0 23
  • 最近這段時間其實一直都在騙自己,特別認真的騙自己,騙自己騙到真的覺得自己已經完全走出來了,該放下的都放下了,慶幸...
    傳說中說大頭目閱讀 315評論 0 0
  • 最近安裝了抖音和微視,分別在上邊發了幾條動態,發現了兩個現象。 一,上邊首頁推薦的視頻更新速度挺慢,過一段時間間翻...
    遇見更好的自己_w閱讀 180評論 0 0
  • 無くした日々にさよなら - スネオヘアー 動漫《在下坂本,有何貴干》片尾曲 昨天和今天的現實 漸行漸遠的瞬間 用雙...
    咖啡與落葉閱讀 212評論 0 0
  • 獵頭工作平臺 經過周五功能演示和調研,目前最為合適我們的是品聘軟件的獵頭管理系統。主要原因如下: 1.擁有獵頭工作...
    林翔_4749閱讀 262評論 0 0