开发者

Are there advantages to only use stored procedures to access a database with merge replication?

I have a project where SPs are the only way that the application uses to access or modify the Sql Server 2008 DB. I have developers asking to abandon the SP only approach and let them use Linq to Sql on the DB directly. I have to decide if to allow this or not. I have to add another piece of information, the project is growing and in the near future we might need a second Sql server machine with merge replication.

I said this because I believed (but I don't find any support to this on the Internet now) that having a SP only approach it's beneficial in a merge replication scenario as this will avoid conflicts and result in a better performance.

Is there any truth to this statement? Could you link to the reference that proves or disproves this statement? What's yo开发者_如何学Gour opinion?

This has come down to be the decisive factor to make the decision.


I don't think Stored Procedures or any other method of changing the data is really a factor in Merge Replication as making an update doesn't directly trigger the change to be pushed down into the distribution database.

For example, if you edit a row via a stored procedure or via Linq to Sql, the change tracking, merging and publishing is the same.

There is a question about the potential for concurrency issues, and the advice is to test for this scenario.

If you are using Linq to SQL you need to make sure you understand when a statement will be executed - this is not specific to Merge Replication.

My final point is to take care of developers who want change for the sake of change. What benefit will Linq to SQL bring to your specific application? What other data access solutions have you looked at before you chose Linq to SQL.

Just because Linq to SQL is great for some applications, it doesn't mean it is perfect for every application and this is what I think should be influencing your decision.

Personally, in your case I would keep stored procedures until you have fully isolated your data access - that is a more important task at this stage.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜