In many approaches to software development like agile methodologies, Domain-Driven Design and Object Oriented Analysis and Design, we are encouraged to take one iterative approach to development. So we are not supposed to get our domain model done right in the first time we start working in the project. Instead, as time goes by we refactor the model because we gain deeper understanding of the problem domain with time.Apart from that, even if we try to get a perfect model upfront, which I'm already convinced is very hard, requirements may change. So after the software has been deployed to production, the end users might notice that a certain requirement wasn't completely understood, or worse, some requirement was missing.The point here is that we may end up needing to change the model after the software has been deployed. If this happens we have a problem: the production database has user's data which is important and is already fitted in the format for the old model.Updating the code might be a hard task if the code is not well designed and if the system is big. But it can be done with time, we have tools like Git which help us do that without damaging the production-ready version.On the other hand, if the model changes, if properties of classes disappear or whatever, the database should also change. But we have a problem: there's already data there which cannot be lost, which is already formated for the old model.It seems that a relational database here is being a barrier preventing us from doing iterative development and even updating software when required by end users.One approach I've already used was to code a special class which maps old database tables to new ones. So these classes pick data in old format, convert it to the format used by the new model, and save to the new tables.This approach seems not to be the best one. My question here is: are there any well-known and recomended approaches to reconcile iterative development with relational databases?
Relational databases and iterative development
database;agile;domain driven design;relational database;ooad