Concurrent Queries Multiple Databases

Sep 9, 2010 at 10:29 PM
Edited Sep 9, 2010 at 10:30 PM

We are building an application that we hope to host in the cloud.  One of the things we are considering is spreading a single clients data across multiple databases.  Is it possible to expose one RIA domain service that will then query multiple databases?

public IQueryable<Library> GetLibrariesForUser()
	Guid userId = (Guid)Membership.GetUser().ProviderUserKey;
	return from x in this.ObjectContext.Libraries
	   where x.LibraryUsers.Any(y => y.UserId == userId)
	   select x;


Is it possible to change the above method of a domain service so that it will run the same query against multiple databases, concurrently, and merge the results together before sending the results to the client?