A Cloud Function's API change is backward-incompatible. You must support existing callers and new callers concurrently. What deployment and API management approach should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Keep the original Cloud Function and deploy a second Cloud Function with the new API; front them with Cloud Endpoints to expose a versioned API..
Why this is the answer
The correct approach is to keep the original Cloud Function and deploy a second Cloud Function with the new API, fronting them with Cloud Endpoints to expose a versioned API. This allows you to manage multiple API versions (v1, v2, etc.) through a single, consistent endpoint, directing traffic to the appropriate Cloud Function based on the requested version. Cloud Endpoints provides robust API management features like traffic splitting, authentication, and monitoring, which are crucial for managing backward-incompatible changes. The other options are less suitable: Using a load balancer between two Cloud Functions is not a standard or efficient way to manage API versions, especially for serverless functions. Load balancers are typically used for distributing traffic across multiple instances of the same service, not for versioning different APIs. Relying on automatic routing for a second Cloud Function with only the changed API is vague and doesn't provide explicit version control or management. Cloud Functions don't inherently offer automatic version-based routing for backward-incompatible changes without an API gateway. Re-deploying a single Cloud Function to handle both APIs with version identifiers in the call increases complexity within the function itself, making it harder to maintain and scale. It also doesn't leverage a dedicated API management solution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed