Niclas Hedhman wrote:
Well, in reality you are talking;
migration.migrate("org.hedhman.niclas.Abc", Def.class.getName())
.isSame();
since the original class is unlikely to still be around, right?
True, it was only for the purpose of testing that using the classname
worked.
Good points. There are also questions around indexing; Since I assume
that the indexing should keep the old types around, one could possibly
leverage indexing for marking the entities migrated with a link or
attribute, in which case a query would answer the question whether any
migration would be needed. If index should be purged of old types,
then such strategy won't work.
But wouldn't it be better to put that info in the main database itself.
It seems scary to rely on the indexing to take care of that, especially
since there might be many indexing subsystems.
Regarding 'backup' database; Well, I would recommend against that as a
general feature. Instead, migrate one object/aggregate at a time, and
just leave the old ones as they are completed. If rollback is wanted,
one can either delete all the migrated objects, or do a entitystore
specific copy of the files, bla bla... We don't have an issue in
general of multiple schemas interference, so things should be fine.
Possibly anice feature could be to allow a migrated object to be
marked read/only, so any old client would be able to read old data,
but not update it.
Ok. The SPI would need to be updated quite a bit to get that going I
think... I want to avoid having to do too many changes to the
EntityStore SPI just to handle migration.
Another question: for this to work properly the EntityTypes of stored
entities needs to be stored themselves in the EntityStore. Otherwise there
is no way to know what old types looked like. There is currently no
implementation of EntityTypeRegistry that does this, so that would have to
be fixed.
Yes, and this would need to be done anyway for "mapping" such as Neo
and QRM entitystores.
Ok, good.
Finally, I am myself a relative newbie at data migration, and am also really
really short on time. If anyone wants to help out with building this
functionality, please do let me know!!
I can take a shot at it, starting shortly... Not that I consider
myself an expert of the field either.
Alright. I have a spike I'm working on right now, but will hopefully
commit that soonish so you can take a look at it.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev