Hi, Phil,

Well, when I read about "commands" modifying the model and stored in a log
for future replay it sounds a lot like Prevayler with the luxury of
automatic "transaction command object" creation based on parameters
extracted via a concern.

Well, I think that the level of discussion here (migration) is very different from Prevayler in that Prevayler's only concern is to be able to backup its state in case of system failure. Prevayler doesn't even care about persistence (as we know it). So, I'm not sure how much of a lesson we can learn from it. That said, though, making transactions serializable so they can be stored like Prevayler does is indeed a neat little trick.


With Prevayler, you are supposed to create snapshots of your model in order to avoid replaying all the commands. Those snapshots could be considered a
cache(command(t)) of your model to optimise replaying at t+1.

I think "you can" is more appropriate than "you are supposed to". :-)

But yes, good explanation.


One problem I had with Prevayler is "snapshot generation". It takes a lot of resources (O(model's value size)). I partly solved it by partitioning my
model in smaller snapshots. But I still had a problem with "dead" old
data... like last year "order lines", they were still present in the
snapshot ! So I had to remove "old values", and it was a mess.

Normally, you shouldn't need to do that. The _only_ thing that is present in the Prevayler snapshot is what you have in your live data model. The state of your system is serialized "as is". So, if you had strange things in your snapshot, it's not because of Prevayler's holding on to it, it's because that data is still around in one of your objects.

That data may still be in your journal files (log of all transactions), but not the snapshot (log of the system's state at time t).


Anyway, I think I understand your line of thinking better. Thank you for clarifying.

Cheers,
=David



_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to