I want to store data to the database using Spring Data REST. The rational is that the DB may change from customer to customer and we would not need to change aspects of the solution that are not stricly related to DB operations. In fact, the database service or implementation could even change without need to restart the application.
Spring Data REST seems to meet our need. Though I have a question that I am not able to see answered.
The data we want to store may have different data formats. From one customer to the other one, new fields might be needed. For instance, for customer A, the Person instances might have 5 fields while for customer B, Person instances would have 8 fields. I understand that with JPA, something like this would be difficult to support.
However, given NoSQL databases such as MongoDB and Cassandra support this capability, I was wondering if there is a way to force Spring DATA to accept such additional fields without having to rebuild things. My guess is that I have to implement my own repository. Any less painful approach?