Is it Possible to Query Multiple Databases with WCF Data Services?

ぐ巨炮叔叔 提交于 2019-12-06 12:52:14

I think you have to write a facade service that will dispatch the query to the underlying - either in sequence or in parallel. You will typically create the facade in such a way that the WCF Data Service uses the Reflection Provider and you can use LINQ to SQL or Entity Framework for the underlying databases.

How to: Create a Data Service Using the Reflection Provider (WCF Data Services): http://msdn.microsoft.com/en-us/library/dd728281.aspx

HTH,

--larsw

I posted the question on the MSDN forums and found out that it will require a lot of effort.

It involves creating your own data service provider, which is tricky and can be a lot of work. On top of that merging results with sorting + paging will be a task that is far too complicated and risky for what I am willing to do. For example, how do I query multiple databases for page 1000 sorted by the Name column? I would essentially have to query all data from all databases, sort by Name, then select the 1000th page.

Seems like you need to use a different approach. I'm talking about Distributed Caches, such as Oracle Coherence or NCache. The structure is really transparent - you interact with in-memory database that is synchronized with your "backing map" - one or more databases.

There are a lot of interesting features in such caches. for example you can change a store strategy or build a backing map with a different databases (MS SQL, Oracle etc.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!