Module 4: Messaging Services

Looking for ‘Developing Applications in Python on AWS Module 4 Answers’?

In this post, I provide complete, accurate, and detailed explanations for the answers to Module 4: Messaging Services of Course 4: Developing Applications in Python on AWS

Whether you’re preparing for quizzes or brushing up on your knowledge, these insights will help you master the concepts effectively. Let’s dive into the correct answers and detailed explanations for each question!

Matching

Practice Assignment

1. Which Python package is used to make calls to AWS services from applications?

  • NumPy
  • Requests
  • Certifi
  • Boto3 ✅

Explanation:
Boto3 is the official AWS SDK (Software Development Kit) for Python that allows developers to write software that makes use of Amazon services like EC2, S3, DynamoDB, etc.

  • NumPy: used for numerical operations
  • Requests: used to make HTTP requests
  • Certifi: handles certificates for secure HTTP

2. An application programmer is working on code to store a PDF file in Amazon Simple Storage Service (Amazon S3). What is the correct Python code to complete this task?

Explanation:

  • put_object() is the correct method to upload files to an S3 bucket.
  • Body: the content to be uploaded (like a file path or binary stream)
  • Bucket: the name of your S3 bucket
  • Key: the name the file will be stored as in the bucket (e.g., 'HappyFace.jpg')
    Note: File content 'customer.pdf' is being uploaded as 'HappyFace.jpg' — you could change the key name to 'customer.pdf' to match the actual file.

3. Match the statements to the correct type of database.

Explanation:

  • Relational databases (e.g., MySQL) use SQL, predefined schemas, and traditional engines.
  • Nonrelational databases (like Amazon DynamoDB) offer more flexibility with schema and simpler APIs like get_item() and scan().

4. An application programmer is writing an application that retrieves loan applications, processes the application, and then delivers the results to an API. The application will be scaled out by running on multiple hosts. The application needs to be resilient against host reboots, so the messages need to be stored durably.

Which service meets the requirements for storing the loan application messages?

  • Amazon Simple Notification Service (Amazon SNS)
  • Amazon Simple Storage Service (Amazon S3)
  • Amazon DynamoDB
  • Amazon Simple Queue Service (Amazon SQS) ✅

Explanation:

  • Amazon SQS is a fully managed message queuing service. It stores messages durably and ensures delivery even if the application crashes or reboots.
  • SNS is for pub/sub notifications, not ideal for durable message storage.
  • S3 is for storing files, not message queues.
  • DynamoDB is for NoSQL data, but not specifically message queuing.

5. An application programmer is working on an event driven architecture with Amazon EventBridge. The programmer has been asked to implement a feature that will respond to an event that contains a reference to an image in an Amazon Simple Storage Service (Amazon S3) bucket. When the event occurs, the image needs to be resized to a thumbnail image.

Which type of rule target can be used to create the image resizing?

  • Amazon Simple Queue Service (Amazon SQS) queue
  • AWS Lambda function ✅
  • Amazon Simple Notification Service (Amazon SNS) topic
  • Amazon CloudWatch Logs log group

Explanation:

  • Lambda is the ideal compute service for event-driven tasks.
    When EventBridge triggers an event (e.g., a new image in S3), Lambda can run custom code (e.g., image resizing).
  • SQS and SNS are messaging tools, not compute.

Leave a Reply