What is meant by non-destructive schema evolution in Anchor Modeling?

702 views Asked by At

Say you have an Anchor Model and replace a single Name attribute with three attributes: FirstName, MiddleName and LastName. What happens to the original name attribute? I can imagine other schema changes that feel destructive, so what is meant by Anchor Modeling's claim to evolve schemas in a non-destructive way?

1

There are 1 answers

1
Mark Canlas On

Destructive operations affect uptime

It probably refers to its interaction with uptime. If you ALTER a sufficiently sized base table, you will suspend requests to it until it is complete. With anchor modeling, there is no such scenario since new columns are new entities that do not interact with the base tables (in terms of blocking I/O operations to the base table, besides deletes, which is moot since new columns are implemented as empty tables).

So, let's say you have a Person base table with a FullName attribute. And then you've non-destructively evolved to include FirstName, MiddleName, and LastName. The FullName table would probably continue to be useful until all code paths adopt First, Middle, and Last. At this point it becomes a sort of vestigial organ, to continue the evolution analogy.

Auditing (deleting) this table is also non-destructive. As a separate entity, the destruction of its lifetime does not interrupt the operation of any of the base or attribute tables.

So that's probably what the anchor model authors meant by destructive.

Destructive to uptime.