Advantages and disadvantages of using stored procedures to encapsulate application logic

Source: Internet
Author: User
Stored Procedures | Encapsulation SQL Server 2005 can write stored procedures in. NET languages, so in small and medium applications, it becomes a good choice to use the stored procedure encapsulation application logic.

The advantages of using stored procedures to encapsulate application logic are as follows:

1, Dba+developer Division of labor Clear. Code modularity between. Reduce database operator and programmer errors.
2. Database security; You can set the account in the connection string to access only stored procedures and not to manipulate tables. Such data integrity is also guaranteed.
3, the stored procedure is compiled, fast execution.
4, transaction level, stored procedure level transaction, Ado.net level transaction comparison. Consistency.
5. Reduce the amount of network traffic. An operation that requires several lines of Transact-SQL code can be implemented by a separate statement that executes the process code, without the need to send several lines of code across the network.

The disadvantages of using stored procedures to encapsulate application logic are as follows:
1. Poor programming language SQL (excluding SQL 2005)
2, not integrated with the programming environment (not including SQL 2005)
3. Poor portability (different databases)
4, the database server pressure is big

Like the current version of the CSDN forum, its application logic is encapsulated in stored procedures. At present a more distressed feeling is that the database server pressure too much. And the cost of buying a more High-performance database server is too high. To this end, the next generation of technical community architecture design, specialized independent of the application of the logic layer. Some adjustments are also made here in the stored procedure. The application logic is no longer encapsulated entirely with stored procedures.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.