iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 26
0
自我挑戰組

AWS Certified Solution Architect 系列 第 26

AWS Certified Solution Architect - Simple Notification System

Table of Content:

  • Introduction of Pub/Sub Pattern
  • SNS
  • SNS-topic
  • SNS-subcription
  • Platform Application Endpoint

Introduction of Pub / Sub

在 pub/sub 模式裡面 publisher (發送訊息者) 不會直接傳送給 subscriber (接收者),而是將訊息傳送至 Event bus 裡,Event bus 會以 channel 來分別是哪種訊息,而 subscriber 會依照需求來去訂閱(subscribe) channel。

https://ithelp.ithome.com.tw/upload/images/20200926/20129560dgYkvkwUlW.png

大致完成一次發送訊息的流程如下 :

  1. publisher 發送訊息至 Event bus 並指定是哪個 channel
  2. Event bus 收到訊息後,依照 channel 將訊息推送至 channel 裡給在 channel 內的 subscriber
  3. subscriber 收到訊息,並作相對應的處理

從以上流程可以知道這個模式的特性 :

  • publisher 和 subscriber 彼此不認識
  • subscriber 不會去跟 Event bus 要通知

SNS

SNS 是 AWS 提供的高可用、高可靠、安全的 pub/sub 通知系統,能讓妳有效解偶微服務、分散式系統、無服務架構應用程式之間的關係

https://ithelp.ithome.com.tw/upload/images/20200926/201295603QVHdeXJVC.png

SNS Topic

topic 讓你將多個 subscriber 聚集在一起

  • topic 能夠同時傳送不同協定的訊息(HTTP(s), text message, Email)
  • 當 topic 傳送訊息至 subscriber 時,topic會依照該 subscriber 要求的協定重構訊息
  • 可以使用 AWS KMS 加密 topic

SNS Subscriptions

一個 subscription 只能訂閱一個 topic 和指定一種協定

SNS支援的協定 :

  1. HTTP & HTTPs : 和你的應用程式建立 webhook
  2. Email : 只支援 plain-text 格式,很適合內部Email通知使用
  3. Email-JSON : 透過 Email 傳送 JSON
  4. Amazon SQL : 將 SNS 訊息傳送至 SQS
  5. AWS Lambda : 觸發 Lambda function
  6. SMS : 傳送文字訊息
  7. Platform Application Endpoint : 行動裝置的推播

Platform Application Endpoint

剛剛提到的 Platform Application Endpoint ,是發送訊息至各家OS和平台自己做的通知系統

像是:

  • Amazon Device Message (ADM)
  • Apple Push Notification Service(APNs)
  • Baidu Cloud push (Baidu)
  • Firebase Cloud Messaging(FCB)
  • Microsoft Push Notification Services for Windows phone(MPNS)
  • Microsoft Push Notification Service(MNS)

https://ithelp.ithome.com.tw/upload/images/20200926/20129560B4Ei6Q4fYU.png


上一篇
AWS Certified Solution Architect - ELB (Part 2)
下一篇
AWS Certified Solution Architect - SQS
系列文
AWS Certified Solution Architect 30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言