Avoiding service versioning
In Chapter 1, Setting Up Your Mindset for Microservices Endeavor, we talked about the API-first approach as part of the additional factors of building cloud-native applications in addition to the Twelve-Factor App methodology. The API-first approach emphasizes defining a service contract that dictates the behavior of a service. The service API is a contract between a service and its consumers. The service might undergo many changes during its life cycle, which might require changes to its API. A service could have multiple consumers, and it's crucial to ensure backward compatibility during several API changes to allow different consumers to continue their operations without making any changes.
The API changes can be broadly categorized as breaking and non-breaking. Breaking changes require clients to update to a newer version of the API, while non-breaking changes don't affect clients and allow them to continue working with the older version...