Questions 28 to 30

Explanations for questions 28 to 30

We'll cover the following

Question 28

An application running on Amazon EC2 needs to asynchronously invoke an AWS Lambda function to perform data processing. The services should be decoupled.

Which service can be used to decouple the compute services?

  1. Amazon SQS
  2. Amazon SNS
  3. Amazon MQ
  4. AWS Step Functions

Correct Answer: 2

Explanation: You can use a Lambda function to process Amazon Simple Notification Service notifications. Amazon SNS supports Lambda functions as a target for messages sent to a topic. This solution decouples the Amazon EC2 application from Lambda and ensures that the Lambda function is invoked.

INCORRECT: “Amazon SQS” is incorrect. You cannot invoke a Lambda function using Amazon SQS. SQS is pull-based (so Lambda can be configured to poll a queue), but this problem requires push-based like SNS.

CORRECT: “Amazon SNS” is the correct answer.

INCORRECT: “Amazon MQ” is incorrect. Amazon MQ is similar to SQS, but it is used for existing applications that are being migrated into AWS. SQS should be used for new applications being created in the cloud.

INCORRECT: “AWS Step Functions” is incorrect. AWS Step Functions is a workflow service. It is not the best solution for this scenario.

References:

https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html

https://aws.amazon.com/sns/features/

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.