Best architecture for accessing secondary database
I'm currently developing an app which will use a Linq to SQL (or possibly EF) data access layer. We already have a database which holds all 开发者_开发技巧our Contacts information, but there is currently no API around this. I need to interact with this DB from the new app to retrieve contact details.
I can think of two ways I could do this - 1) Develop a suite of web services against the contacts database 2) Write a Linq to SQL (or EF) DAL and API against the contacts database
I will probably be developing several further apps in the future which will also need access to the Contacts data.
Which would generally be the prefered method? What are the points I need to consider? Am I even asking a sensible question, or am I missing something obvious?
You would develop a set of web services if you will need to retrieve information from the database across the internet, or across some other boundary like a department, where the contacts database is not directly accessible.
Otherwise, I would go the simple route and wrap a DAL around it. Developing web services is more expensive at several levels, so consider carefully your need before you do that.
精彩评论