i m doing a project with spring data. I have two table in my schema:
- Hu
- Movement: this table must contain each movement of hu. In production this table will have a lot of record so i will put the movement data on mongodb databale.
I've read that it is possible to use more datasource. But it is possible to use a mysql datasource and a mongodb datasource? If yes is possible to link HU to movement ( a join ) ? Movement collection have hu_id column.
yes it is possible to use two datasources one is SQL and the other one is NOSQL.
But I feel linking between two entities is not possible and it doesnt sound right.
Anyway, I have tried this approach where
Entity1.java :(SQL entity)
Entity2.java :(NOSQL entity)
Entity1Repository :
Entity2Repository :
While performing CRUD operations on the entity:
Make use of appropriate repos to perform.
Please go through this project tried : https://github.com/BarathArivazhagan/Spring-MongoDB-Samples/tree/tree/Spring-Data-Mongo-SQL