microstream
microstream copied to clipboard
LegacyTypeMapping - add feature to rewrite all objects in DB to actual state
Add feature, to rewrite all objects already saved in DB to actual state by legacy type mapping.
In DB world is something like "Vertical Partitioning".
One example.
I have an class Person with photo. After 10 000 saved Person i recognize, the photo takes lot of memory and i will add photo as a subclass for person with lazy. I can do it, and add to in LegacyTypeMapping in CSV file. The Person will now correct saved and old one will correct loaded. But the memory problem is still there.
+-------+ +----------+ +--------+
| name | | name | | Photo |
| photo | | Lazy +-------+ |
| | +-------> | | +--------+
| | | |
| | | |
| | | |
+-------+ +----------+
So i would like to have a feature, what this whole CSV file reads and updates the existing elements in storage to actual versions.
Are there any plans to implement this feature?
Maybe this can be archieved with the existing APIs. Just rewirite the whole storage root with an eager storer
Some new utility classes that help to update the persisted state of legcy type mapped instances: feature/LegacyTypeMapping_updatePersistedState_#191
Is there some update with the "PersistenceLegacyTypeHandler"?
The code is not yet merged into the main Microstream branch. If you need that feature, the code in the feature branch works and it should be easy to adapt the code so that you can use it without modifying Microstream.