In Kevin Goldsmith 2015, talk about microservices in Spotify (from 15:25 to 17:43), he mentions that when they create a new version of the API, they simply create a new server and maintain the old server working with the old version, until while clients are still ringing on it (in this case, a smart lamp with built-in Spotify on it).
I am confused about how they will be able to support and offer older versions for potentially years when there are likely to be changes to the database schema over this period of time?
I see several possible solutions, but none of them seem very reasonable:
- Using the same database in all versions, only ever add new tables and new fields with a zero value. Never delete fields, do not rename fields and do not put fields in non-empty ones, and also do not delete tables or rename tables.
- Using a different database for one version, save the data of each version separately.
- Using a different database for each version, save the data of each version separately, but write a way to migrate and transfer requests from one version to another so that each version receives a request with valid parameters for this version.
Solution 1 sounds like it causes too much code smell, with the ubiquitous code of legacy code (which, in my opinion, Kevin does not seem to do this).
2 , . , , , , , ?
3 , , . , ( ) , , , , .
, - , , , , ?
!