seppevs/migrate-mongo

Add check for backwards compatibility

stanyq4 opened this issue · 0 comments

In our development process, we enforce 100% backwards compatibility to all the DB schema changes to support all the legacy.
The process of enforcement is only done during the schema design phase and code review phase, which means there is still a potential for human error.

We are looking to add a programmatic check to accomplish backwards compatibility.

Something like:

  • Any change to a field structure (Data Type/Object Structure) should be performed by introducing a new field instead of mutating an existing one.

Before applying changes - analyze the existing data and ensure the change will not break rules.

This would be a new flag -ensureBackwardsCompatibility during the run phase.

Is this something you considered or are there alternative ways to achieve our goal?