Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring and Mixing SQL and NoSQL db

The answers to my previous post encouraged me mixing SQL and NoSQL db.

What is the best practice implementation of two databases in terms of application context configuration and DAO creation?

Let's choose Derby as the SQL db and Cassandra as the other one. What I am searching for is e.g. an example appcontext.xml, two DAOs, one implementing CRUD on Derby and the other one ond Cassandra and one (not two) sample unit test using both DAOs simultanously.

Tutorials, sample (maven ;-) ) projects, book recommenditions etc. welcome.

like image 208
Ta Sas Avatar asked Nov 06 '22 11:11

Ta Sas


1 Answers

Try spring-data http://www.springsource.org/spring-data (an introductory reference video here)

i think Spring Data JPA provides a repository programming model that starts with an interface per managed domain object. May be we can switch or point domain to different data stores. i haven't tried out this by myself. You can check getting-started-with-spring-data-jpa

but combining nosql and relational will be complex. but one can persist certain type of data into one store based on the its segregation level. i am not sure the transaction isolation possible for multiple data stores.say you store documents to one store and relational data to one which requires data integrity if needed.

like image 181
zudokod Avatar answered Nov 11 '22 05:11

zudokod