Hibernate version:3.0
Hi,
We are planning on customizing hibernate to store historical data. I am aware of
http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/06/19/ and all the threads in forum related to it. We are not fond of the above prescription because we have a large document that we are trying to store revisions for. The # of attributes for each document is dynamic. And only a small number of attributes can change upon each revision. We are not too concerned about the space required to clone the object for each revision. We are concerned about the time used to insert these dynamic properties because we have many inserts happening at the same time. As an example of scale, we can be concurrently try to 100k inserts in which each insert is 100k (the diff with the older version is already done by insert time).
We are looking onto other possibilities. So far these are some ideas to store revision (not exactly a Hibernate issue):
1) Store full copies of key revisions, and store the commands to gather the revisions in between. For example, store revisions 1, 6, and if 4 is requested, we will re-apply the commands on key revision 1, up to version 4.
2) For the objects with dynamic properties, store the start and end version of each property, based on the parent object's version. We can retrieve an object by looking for attributes whose start version is <= the object's version (I can elaborate on this if anyone is interested).
Q: Are there other ways to store revision that people have seen?
Q: Are their plans for Hibernate to support historical data?
Second part of my question is about the way I plan to extend Hibernate to support historical data for all the objects stored through my storage layer.
a) we plan on extending Basic*Persister, parse the queries, and modify the query that Hibernate generate according to whichever historical strategy we choose. We are attempting to parse and modify the queries during run time, and not hardcode the queries in the mapping file. Am I digging a grave for mysyelf?
Thanks!
Theen-Theen