Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 326 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 326

Single answerGoogle Cloud Platform

You are developing an API for a retail application and need to create a versioning strategy to ensure backward compatibility for existing clients while enabling new features for future clients. You are using Apigee for API management. Which of the following approaches should you implement?

  1. A

    Use a version number in the URL path (e.g., /v1/products) to differentiate versions of the API.

  2. B

    Deprecate the older API version immediately when a new version is released to simplify maintenance.

  3. C

    Use a custom header to specify the API version (e.g., X-API-Version: 1).

  4. D

    Implement feature flags within a single API version to control access to new features without versioning.

Show answer and explanation

Correct answer: A

Explanation

The best practice for versioning APIs, especially when using Apigee or other API management tools, is to include the version number in the URL path. This approach ensures clarity for clients, makes testing and debugging easier, and aligns with industry standards. While other methods like custom headers or feature flags can be useful in certain scenarios, they do not provide the same level of explicitness and simplicity as URL-based versioning.

  • A. Correct.

    Using a version number in the URL path (e.g., /v1/products) is a widely adopted and recommended approach for API versioning. It provides clear separation between versions and allows clients to explicitly request the version they need, ensuring backward compatibility.

  • B. Incorrect.

    Deprecating the older API version immediately when a new version is released can break existing clients and is generally not a best practice. A deprecation period is recommended to give clients time to transition.

  • C. Incorrect.

    Using a custom header to specify the API version is a possible approach, but it is less intuitive and less commonly used compared to versioning in the URL path. It can also lead to confusion for clients who are unfamiliar with the custom header.

  • D. Incorrect.

    Implementing feature flags within a single API version is useful for enabling or disabling features dynamically but does not address the need for a clear versioning strategy. It can lead to complexity if multiple features are controlled this way without clear version separation.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam