Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm taking a bit of a wild shot here, because I didn't refactor too much data in my life. </p> <p>You're making a strange comparison: If you wanted to 'hot-migrate' the db, you'd probably have to do the <code>x+1</code>, <code>x+2</code> versioning approach you described, but I don't really know - I wouldn't know how to do this with SQL either since I'm not a db expert.</p> <p>If you're migrating 'cold', however, you could just do it in one step by instantiating a new object from the old data, store the new object, delete the old object for each object in the store. See <a href="http://developer.db4o.com/Documentation/Reference/db4o-7.4/net2/reference/html/reference/implementation_strategies/refactoring_and_schema_evolution/refactoring_class_hierarchy/removing_class_from_a_hierarchy.html" rel="nofollow noreferrer">db4o reference</a>.</p> <p>But honestly: the same process in a RDBMS is complicated, too, because you will have to de-activate constraint checks (and possibly triggers, etc.) to actually perform the operation - perhaps not in the example you provided, but for most real-world cases. After all, the string split is so easy that there will be little gain.</p> <blockquote> <p>In SQL I would simply populate "first_name" and "second_name" columns</p> </blockquote> <p>Yes, with a <em>simple</em> string split operation, you can <em>simply</em> do that. But in a typical refactoring scenario, you're re-structuring objects based on large and complicated sets of rules that might not be easily expressed in SQL, might need complex calculation, or external data sources. </p> <p>To do that, you'd have to write code, too.</p> <p>After all, I don't see too much difference in the two processes. You will always have to be careful with live data, and you will certainly make a backup in both cases. Refactoring is fun, but persistence is tricky so synchronizing it is a challenge in any case. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload