Have you ever seen a significant non-theoretical project where the underlying database engine had to be changed? Was it a major undertaking, taking months of work, or was it conceived and done in a day/week?
I have seen a few online posts/messages conveying one to write database-handling code in such a way as to allow an easy change of the underlying database engine, perhaps by modifying a few key files and without changing the "rest of the code". The underlying theme is that "what if" one has to stop using MySQL and start using Oracle? Or PostgreSql? Or.. I don't know, MongoDB, NoSQL, flatfile, BerkeleyDB?
Did that ever happen on a real-life project where you did have to change the underlying database engine? If so, did the existing codebase allow to do so easily?
Does such thing happen often in real-life scenario? I haven't seen it myself. I am also pretty sure that large companies will not bother changing their database (think of Facebook deciding to change their main application database engine), and if they do it will probably a major major undertaking.
In the end I wonder if one can safely write their code as if they are married to the current database of choice - for example, using
mysqli_query() all throughout their codebase for MySQL.