We are considering Terracotta for our next project. I am intrigued by its potential to provide data persistence without the need for a separate DBMS. (See also On using Terracotta as a persistence solution)
One of the major pains of software evolution is to make the existing production data conform to the new data model. For an RDBMS you'd likely use a SQL change script at the moment of deployment. For Terracotta backed data, it is not immediately clear to me how to deal with non-trivial evolution.
There's a couple of paragraphs on Class Evolution in the Terracotta documentation but it seems specific to DSO and stays rather superficial.
- What are possible ways to handle data model evolution for the persistent data stored in Terracotta? I'm particularly interested in the non-DSO scenario (i.e. through the Terracotta Toolkit API).
- Do Terracotta DSO and the Toolkit API differ in their reactions to evolved class definitions?
- To understand the limitations of class evolution it would help to know how Terracotta represents/communicates object data; is there a specification for that?
- Maybe there are schema evolution techniques from the OODBMS world that are applicable to Terracotta?
As a trivial example, let's say I have a bunch of Car
objects stored and I've changed the modelYear
field of the Car
class from a String
to an int
. According to the documentation this does not work out-of-the-box. I can imagine a solution where my old Car
is loaded by a seperate classloader during application startup, and then converted to a new Car
. Would that be a good approach and why (not)?