are you talking about storing a single entity across multiple databases, or 
sharding the database to store the same type of data across multiple 
databases?
NH has an extension for sharding, but I'm not aware of the state of this 
projects. It's part of NH contrib, iirc.

if you are talking about storing a single entity across multiple databases, 
the answer is not cleanly. you might be able to do something with custom 
user types and/or event listeners to hydrate the object, but that would be a 
mess to maintain.

A different approach is to transfer the data from one db to another using an 
ETL process. similar to replication, but only transferring the data required 
by the other database. you end up with 1 writable database and many read 
databases. then you map the domain to a single database.

Another option is to determine why there are multiple databases. if they 
represent different types of data/objects then explicitly express this in 
the domain. for example CustomerWithAddress is a different entity than 
CustomerOrder. If you need information from both, then query each database 
individually and build up a projection in code.
var x = session1.get<CustomerWithAddress>(id);
var y = session2.get<CustomerOrder>(id);
return merge(x, y);

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to