Search for existing suggestions

Mapping single model to multiple databases

Like to be able to build a domain model over data in multiple databases. With out having to manage database objects - linked servers, views etc.

818 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Noel shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

31 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Arkadiusz Kaminski commented  ·   ·  Flag as inappropriate

    It'd be great if this feature was implemented in EF. I'd reduce lots of hassle with creating views / store procedures to bypass that limitation.

    On the other hand: while developing multi database enterprise solutions you may look into the SOA approach.

  • Ladislav Mrnka commented  ·   ·  Flag as inappropriate

    "Without having to manage database objects - linked servers ..." That is totally out of scope of ORM. You should always have to do that even if cross database mapping will be supported. There is a big difference between cross database and cross server queries.

  • Rachel commented  ·   ·  Flag as inappropriate

    If your database supports Synonyms, it is possible to make an EF model span multiple databases. EF doesn't treat a Synonym any different than it would a regular database table, so you can merge two edmx files and it will treat the 2nd database as part of the first one providing the synonyms are setup. I wrote about how to do it in the following link, which includes scripts for generating synonyms and merging edmx files. http://rachel53461.wordpress.com/2011/05/22/tricking-ef-to-span-multiple-databases/

  • Marcel Roma commented  ·   ·  Flag as inappropriate

    Most enterprises today have very heterogenous and fluctuant data environments. Beeing able to span an abstract model across several data sources would definitely make EF the product of choice when it comes to data access modelling and also would increase EF's rate of adoption.

  • Daniel G commented  ·   ·  Flag as inappropriate

    This is essential for enterprise development. Please do not overlook this.

  • Tony Fabrikant commented  ·   ·  Flag as inappropriate

    This is a very real need for a lot of existing applications. The ability to expand the data model over more than one database will finally make EF the best option for a lot of projects. Having the entities from multiple dbs in one cohesive graph will streamline development and result in much cleaner code.

2 Next →

Feedback and Knowledge Base