Database schemas evolve. New tables or columns are added. Tables are joined or split. Column types change, and indexes need tuning. In my experience, in a successful project, the schema changes almost as often as the code does.
This has always been the case, but in the past, we relied on expensive database comparison tools or manually crafted SQL files that were reviewed by a DBA before being executed in a production environment.
In today's agile world, this is no longer acceptable. You need to be able to change the schema as easily as you change the rest of the code. From my experience, the best approach is to treat the database schema as an implementation detail of the codebase. This approach gives you the freedom to apply changes at the optimal moment.
I've built systems leveraging this capability to support blue-green deployments and handle data migrations between software versions with zero downtime. It also enabled seamless transitions from
#SQL to
#NoSQL. It's another step toward a world of
#painless deployments.
#lessonslearned #databases #consultancy #avivasolutions #tables #databaseschema