microstream
microstream copied to clipboard
Implement ReasonableStorer
Is your feature request related to a problem? Please describe.
For beginners with MicroStream it's kind of hard to understand, what exactly should get stored. (Always store "Reference holder", so for example if you change a list, you must store the list and not the object referencing the list)
From https://docs.microstream.one/manual/storage/storing-data/lazy-eager-full.html:
LazyStorer
: Referenced instances are stored only if they have not been stored yet. If a referenced instance has been stored previously it is not stored again even if it has been modified.
EagerStorer
: In eager storing mode referenced instances are stored even if they had been stored before. Contrary to Lazy storing this will also store modified child objects at the cost of performance.
Describe the solution you'd like
I propose a new Storer-Type (f.e. ReasonableStorer
) where you can for example always throw in the Root-Object and the storer traverses the complete tree and saves all changes.
This is a terribly poorly performing Storer, but this would decrease the entry barrier for beginners of MicroStream and decrease complexity of code for small data stores.
Describe alternatives you've considered
If you use the store
-Method mindfully, this storer-type is not needed.