To create an evolvable API, stop thinking about URLs
- To build an evolvable API, instead of forcing clients to have prior knowledge of URLs, fields and HTTP methods, you should let the client ask the server what is required to complete an operation and indicate the preferred host and path.
- Critical aspects of evolvable API include:
a) The state of the conversation being stored in the network - not sourced from either client or server.
b) No versioning needed - when you add or remove data from a response, clients should know how to react. If they don’t know how to react to a new feature, they should be able to ignore it and work in the old way.
c) The server owns actions which contain values for URLs, methods, and fields, so that they control where clients go to continue the conversation, with only the entry point hardcoded in the client.
- With control of URLs in the server, it can run A/B testing and direct clients to different servers running the same instance of the application. The server can also implement a polling functionality to track the status of requests.
- Model communication on how people actually operate. Think not only about a generic language but developing a shared domain vocabulary.
Full post here, 10 mins read