PROFESSIONAL-CLOUD-DEVELOPER · Question #7
You are working on a social media application. You plan to add a feature that allows users to upload images. These images will be 2 MB ?1 GB in size. You want to minimize their infrastructure operatio
The correct answer is B. Change the application to create signed URLs for Cloud Storage.. Cloud Storage signed URLs allow a client (browser or mobile app) to upload a file directly to a Cloud Storage bucket without routing the data through your application server. The application server generates a time-limited, pre-signed URL and hands it to the client; the client th
Question
You are working on a social media application. You plan to add a feature that allows users to upload images. These images will be 2 MB ?1 GB in size. You want to minimize their infrastructure operations overhead for this feature. What should you do?
Options
- AChange the application to accept images directly and store them in the database that stores other
- BChange the application to create signed URLs for Cloud Storage.
- CSet up a web server on GCP to accept user images and create a file store to keep uploaded files.
- DCreate a separate bucket for each user in Cloud Storage.
How the community answered
(23 responses)- A13% (3)
- B78% (18)
- C4% (1)
- D4% (1)
Explanation
Cloud Storage signed URLs allow a client (browser or mobile app) to upload a file directly to a Cloud Storage bucket without routing the data through your application server. The application server generates a time-limited, pre-signed URL and hands it to the client; the client then streams the binary directly to GCS. This approach eliminates the need to scale your app server to handle large binary payloads, drastically reduces bandwidth costs, and leverages Google's globally distributed, highly available object storage. Option A (storing images in the database) is inappropriate for files up to 1 GB-databases are not optimized for blob storage and this would cause severe performance and cost issues. Option C (a dedicated web server with a file store) reintroduces the infrastructure management overhead the question seeks to avoid. Option D (a separate bucket per user) adds complexity without a benefit-a single bucket with appropriate prefixes or IAM policies is sufficient.
Topics
Community Discussion
No community discussion yet for this question.