Slim Model Instance Backup [message #900567] |
Tue, 07 August 2012 14:48 |
Hauke Fuhrmann Messages: 333 Registered: July 2009 |
Senior Member |
|
|
Hi there,
I want to work with EMF model instances in memory mainly, i.e. I don't
need files to load the model from; I get most data from external messages.
Only in case the computer or JVM crashes, I need to restore the EMF
model where it was left before the crash.
Hence, I need a slim mechanism to synchronize all changes of the model
into a persistency solution (file, database...) which I can read in
again when starting up the application.
An EMF-framework to databases seems to be overkill, isn't it?
However, the plain XML persistency seems to be not very performant if
you save the ressource with every little change of the model.
Something like storing only the small deltas of the model would be good,
which would have very good write performance (done very often) and only
bad/medium read performance (done quite seldom).
Is there any suggestion/best practice?
Cheers,
Hauke
|
|
|
Re: Slim Model Instance Backup [message #900666 is a reply to message #900567] |
Wed, 08 August 2012 06:13 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Hauke,
Comments below.
On 07/08/2012 4:48 PM, Hauke Fuhrmann wrote:
> Hi there,
>
> I want to work with EMF model instances in memory mainly, i.e. I don't
> need files to load the model from; I get most data from external
> messages.
>
> Only in case the computer or JVM crashes, I need to restore the EMF
> model where it was left before the crash.
> Hence, I need a slim mechanism to synchronize all changes of the model
> into a persistency solution (file, database...) which I can read in
> again when starting up the application.
>
> An EMF-framework to databases seems to be overkill, isn't it?
> However, the plain XML persistency seems to be not very performant if
> you save the ressource with every little change of the model.
BinaryResourceImpl produces a very compact representation that's
generally an order of magnitude faster to read and write.
>
> Something like storing only the small deltas of the model would be
> good, which would have very good write performance (done very often)
> and only bad/medium read performance (done quite seldom).
A ChangeRecorder which is able to produce a ChangeDescription which can
be serialized could serve that purpose. Perhaps looking at the JUnit
tests for that will give you the idea how to use it.
>
> Is there any suggestion/best practice?
>
> Cheers,
> Hauke
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03102 seconds