I have been unsuccessful finding answers/topics in this forum related to the following scenario.
Ours is a distributed high volume data driven SOA system written originally in C and now getting migrating to Java. The database schema is distributed and follows the pattern of one database per top level entity. For e.g: Customer is in CustomerDB, Account is in AccountDB, user in UserDB and so on. There may be related tables to each of these entities in the same database, for e.g: UserDB has UserProfile, etc but as the entire system, the high level domain objects are residing in their own distributed database schemas. Due to database limitations when a table in one schema grows too big, it gets split up and put into its own database, giving it the more resources. A lot of these data model decisions are due to the legacy I won't be able to answer why it has been designed this way. The C services seem to work well in this model and most of the business logic are database centric.
Now that we are moving to Java, we want to take advantage of the OO features and write code rich in OO and not Db centric. The problem now is how do I map my Java entities to DB objects that are residing in multiple databases? I want to be able to navigate through the object graph from Customer to Account to Order etc. I looked at the Hibernate Shards but it only deals with multi-tenancy and partitioning based on the data range, all the databases are still having the same schema.
Any usecase logic would involve call to multiple databases to gather its data and work on it (today it happens as discrete service calls to each of these databases). How do I accomplish mapping Java classes in my application to multiple databse schemas, thereby using all the Hibernate features? Any advise on this problem would be very helpful
Thanks Sairam
|