Advantages and disadvantages of using stored procedures in system development

Source: Internet
Author: User

In system development, it is common to use stored procedures to complete some functions. Because of high performance requirements or large data volume operationsProgramming LanguageDevelopment has considerable performance advantages. I have seen that the stored procedures used by a system can be described in many ways. Basically, all operations are stored in databases. When I first came into contact with the system, I admired the system's designers and DBAs. He has been playing with SQL. He writes SQL directly in notepad, and then writes hundreds of lines of scripts. Basically, he does not need to debug and run the script.

However, when I understand the business of the system and perform secondary development, I find it very painful. Because errors occur during the storage process, they cannot be easily tracked as in Visual Studio, you can skip this step. We can only print or raiserror ('',) to solve this problem. It is a matter of patience. At the same time, I also found that the bug in the stored procedure is easy to release once it is solved, and no release is required.Program.

The advantages of listing stored procedures are as follows:

1. High execution efficiency.

2. Good security performance.

3. It is very easy to implement requirements for some occasions.

Disadvantages:

1. Poor maintainability.

2. Poor readability.

When we are modifyingCodeWe can search all through vs to confirm that unnecessary code can be deleted, but the stored procedure is not that easy. Of course, you can search all the stored procedures of the database, however

Those database jobs or other databases may use this stored procedure. You are not so easy to confirm.

Therefore, I personally think that the storage process should not be abused during system development, and it is troublesome to use more maintenance later, some operations that can be implemented in the Code and have little impact on the system performance do not need to be written in the stored procedure, and

To solve the issue of easy release, you can consider completing some business operations on the server and replacing some stored procedures with services.

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.