考题解析 | AWS 构建松耦合的应用程序解决方案


  题目

You have been called in to consult with a Mobile App company around a challenge. Their app, ABCom, allows people to take very high-resolution multi-megabyte pictures of their food and derives the nutritional value from the photo. They are due to launch within 5 days and must be ready to scale as the app is expected to be a hit. Unfortunately, the machine learning portion of the app is not yet perfected so they have recruited many analysts to view the photos, lookup the nutritional value and return the info to the user.

How would you best architect for this scenario?

A. Create a pub/sub architecture, supplying the analysts with a custom program they can use to receive images pushed from SQS queues and process the images.
B. Use SNS to create a process which will email received images equally across a set of email accounts. Provide the analysts with a custom program to read those mailboxes and process the images.
C. Use Kinesis Data Stream and Kinesis Firehose to take in the image and save them off to S3. Write a custom program that analysts can use to view the S3 images and process them.
D. Use AWS SWF to receive the images from the mobile app. Use the weighted routing feature in SWF to forward the images equally across a pool of analysts to process the images.
E. Configure the app to upload the image to S3. Using S3 Events, trigger a message to an SQS queue linking to the image. Provide analysts with a custom program to poll the queue and process the images.

  参考答案

E

  参考解析

技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。

A. 不正确。明显错误选项。Amazon SQS (Amazon Simple Queue Service) 是一种完全托管的消息队列服务,可轻松分离和扩展微服务、分布式系统及无服务器应用程序。SQS 采用 push/pull ,而非 pub/sub 架构。
B. 不正确。明显错误选项。Amazon SNS(Amazon Simple Notification Service)是完全托管的 pub/sub 服务,Amazon SNS 遵循“发布/订阅”(pub/sub) 消息收发范式,客户端无须无需定期检查或“轮询”新信息和更新。每个订阅者都会收到完全相同数量和内容的消息的副本。
C. 不正确。不太恰当的选项。存储在 Kinesis 数据流中的数据最大值为 1MB,SNS 和 SQS 能够存储的消息内容的最大值为 256KB,而用户上传的图片都是高分辨率的图片,尺寸很可能远远超过 1M大小,因此这三种服务都无法充分满足业务需求。
D. 不正确。明显错误的选项。因为 Amazon SWF (Simple Workflow Service) 虽然提供了提供了一种构建、运行和扩展具有并行或顺序步骤的后台任务的方法,但是并不能为单独的任务分配权重。
E. 正确。