问题描述
我正在听 Hanselminutes 播客;StackOverflow 使用 ASP.NET MVC - Jeff Atwood 和他的技术团队".在播客的过程中,他们谈论了 SQL 服务器,并说一些类似存储过程的时代已经结束"的内容.
I’m listening to the Hanselminutes Podcast; "StackOverflow uses ASP.NET MVC - Jeff Atwood and his technical team". During the course of the Podcast they are speaking about SQL server and say something along the lines of 'The days of the Stored Procedure are over'.
现在我不是 DBA,但这让我有点意外.我一直认为 SP 是提高速度(因为它们被遵守)和安全性的方法,更不用说可扩展性和可维护性了.如果情况并非如此,SP 已濒临绝境,那么什么将取代它们,或者我们将来应该做什么?
Now I'm not a DBA but this has taken me a bit by surprise. I always assumed that SPs were the way to go for speed (as they are complied) and security not to mention scalability and maintainability. If this is not the case and SPs are on their last legs, what will replace them or what should we be doing in the future?
推荐答案
也许我太老派了,或者太懒了,或者两者兼而有之,但我必须不同意.存储过程一次又一次地挽救了一天",因为当出现微小的后端更改或错误时我们只需要修复存储过程而不是更新几十个桌面和 Web 上的桌面应用程序服务器.此外,用户不会被打扰.这样可以节省大量的精力和用户的麻烦.
maybe i'm too old-school, or too lazy, or both, but i have to disagree. Time and again stored procedures have 'saved the day' because when a minor back-end change or bug appears we only have to fix the stored procedure instead of updating the desktop application on several dozen desktops plus the web server. In addition, the users are not interrupted. This saves a great deal of effort and user hassle.
此外,一些数据库操作只会在服务器上更高效,而不是在网络上来回走动,尤其是.当一个存储过程调用另一个调用另一个等等(有或没有游标)
In addition, some DB operations are just going to be more efficient on the server rather than going back-and-forth across the network, esp. when one stored procedure calls another which calls another etc. (with or without cursors)
在 SOA 架构中,更新客户端应用程序问题得到缓解(感谢 maud-dib),但存储过程相互调用仍然比多个网络往返到 SOA 层更有效.更新 SOA 层也并非总是微不足道的.
in a SOA architecture the update-the-client-apps issue is mitigated (thanks maud-dib), but stored procedures calling each other is still more efficient than multiple network round-trips to the SOA layer. And updating the SOA layer is not always trivial either.
这篇关于存储过程 - 天数结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!