之前面試的時候被問道爲啥用mysql存儲過程,或者存儲過程的優勢。做爲一個專業的mysql dba。確定是必需要掌握的。而我只是運維啊 哈哈哈。當時回答的很差,後來整理了
mysql
大概這幾條,存儲過程執行速度快,存儲過程可以減小網絡流量,提升應用程序代碼的靈活性,提升數據安全保護機制。程序員
狂汗啊!看人家洋鬼子整理的多齊整啊。師夷長技以制夷,奮起啊!!!面試
• The use of stored programs can lead to a more secure database.
• Stored programs offer a mechanism to abstract data access routines, which can
improve the maintainability of your code as underlying data structures evolve.sql
• Stored programs can reduce network traffic, because the program can work on
the data from within the server, rather than having to transfer the data across the
network.
• Stored programs can be used to implement common routines accessible from
multiple applications—possibly using otherwise incompatible frameworks—
executed either within or from outside the database server.
• Database-centric logic can be isolated in stored programs and implemented by
programmers with more specialized, database experience.
• The use of stored programs can, under some circumstances, improve the porta-
bility of your application.
1: 存儲程序的是使用可使你的數據庫更安全數據庫
2:存儲程序提供了一種數據訪問的抽象機制,它可以極大的改善你的代碼在底層數據結構演化過程當中的易維護性編程
3:存儲程序能夠下降網絡擁阻,由於屬於數據庫服務器的內部數據,這相比在網上傳輸數據要快的多
4:存儲程序能夠替多種使用不一樣構架的外圍應用實現共享的訪問例程,不管這些構架是基於數據庫服務器外部仍是內部。
5:以數據爲中心的邏輯能夠被獨立的放置於存儲程序中,這樣能夠爲程序員帶來更高,更爲獨特的數據庫編程體驗
6:在某些狀況下,使用存儲程序能夠改善應用程序的可移植性
安全