
Answer-first summary for fast verification
Answer: Leave the original Cloud Function as-is and deploy a second Cloud Function with the new API. Use Cloud Endpoints to provide an API gateway that exposes a versioned API.
The question requires supporting both backward-incompatible API versions for existing and new callers. Cloud Functions are stateless and require separate deployments for each version. Option C is correct because Cloud Endpoints acts as an API gateway, enabling versioned APIs to route requests to the appropriate Cloud Function. This isolates versions and avoids code complexity. Option A uses a load balancer, which is less API-centric and requires manual routing setup. Option B incorrectly assumes automatic routing, which Cloud Functions do not provide. Option D modifies the same function, risking compatibility issues and lacks isolation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You recently migrated a monolithic application to Google Cloud by decomposing it into microservices. One microservice is deployed using Cloud Functions. During modernization, you introduce a backward-incompatible API change. How should you support both existing callers using the original API and new callers using the updated API?
A
Leave the original Cloud Function as-is and deploy a second Cloud Function with the new API. Use a load balancer to distribute calls between the versions.
B
Leave the original Cloud Function as-is and deploy a second Cloud Function that includes only the changed API. Calls are automatically routed to the correct function.
C
Leave the original Cloud Function as-is and deploy a second Cloud Function with the new API. Use Cloud Endpoints to provide an API gateway that exposes a versioned API.
D
Re-deploy the Cloud Function after making code changes to support the new API. Requests for both versions of the API are fulfilled based on a version identifier included in the call.
No comments yet.