Stable API Lifecycle Best Practices for Retail Recommendation Engine

Ensure Stability for Retail Recommendation API

Question

Your company provides a recommendation engine for retail customers.

You are providing retail customers with an API where they can submit a user ID and the API returns a list of recommendations for that user.

You are responsible for the API lifecycle and want to ensure stability for your customers in case the API makes backward-incompatible changes.

You want to follow Google-recommended practices.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The recommended approach for ensuring stability for retail customers who use a recommendation engine API is to use a versioning strategy for the APIs. This allows the API to evolve over time without causing backward-incompatible changes that could disrupt customer applications that rely on the API. Google recommends that version numbers increase on every backward-incompatible change to an API.

Therefore, option C is the correct answer. By using a versioning strategy that increases the version number on every backward-incompatible change, you can ensure that your customers can continue to use the older version of the API until they can migrate to the new version. This also provides a clear and predictable way to manage changes to the API and communicate those changes to your customers.

Option A, creating a distribution list of all customers to inform them of an upcoming backward-incompatible change, is a good practice, but it is not sufficient to ensure stability. This approach assumes that all customers will receive the notification and that they will have enough time to update their applications before the change takes effect.

Option B, creating an automated process to generate API documentation and updating the public API documentation as part of the CI/CD process when deploying an update to the API, is also a good practice. However, this approach does not directly address the issue of backward-incompatible changes and how to manage them.

Option D, using a versioning strategy that adds the suffix DEPRECATED to the current API version number on every backward-incompatible change and using the current version number for the new API, is not the recommended approach by Google. This approach can create confusion for customers who may not understand whether they should use the current version or the deprecated version of the API. It is also not a scalable approach as it can lead to a proliferation of deprecated API versions over time.