Resentment between stored procedures and SQL statements

Source: Internet
Author: User
ProgramSaid: stored procedures or SQL statements, this is a problem.
Currently, Jianghu has three schools, one of which is SQL statement stream, one advocating SQL statements, one being stored in the Stored Procedure School, and the other being moderate, harmonious, so the first two schools were so loud that the moderate school was busy. Currently, the SQL School has a large number of ORM tools headed by nhibloud. Recently, the store process school has its own killer secret. The two schools have been fighting each other for a long time.
The pursuit speed of the stored procedure School is the greatest cost of the stored procedure school. Security is another secret of the SQL statement attacked by the stored procedure, but no one connects to the dynamic SQL of the string, which will become invalid.
SQL statement schools are well-qualified schools, but they are mostly new users. Many old SQL statements have been transferred to the stored procedures of the enemy camp. Many developers of Java help use SQL statements, while those of stored procedures use Microsoft statements.
However, there is also a weakness in stored procedures. portability is one of them. Another aspect is scalability. Generally, large Web applications use multiple Web servers, and then dual-database servers are used for hot standby, one of them is turned on, but it is idle. It only solves the single point of failure problem, but it forms the situation of multiple web application servers and single database servers. If all the operations are implemented using the stored procedure, in this case, the database server is overloaded, and the Web server load is insufficient, and the expansion of the database server is very troublesome, and the investment is large, and the program needs to be modified, investment in Web servers is relatively cheap and easier to scale up.
People in the rivers and lakes are not affected, so it is relatively safe to be moderate. I prefer to put a large amount of burden into the program, and reduce the burden on the database, as long as the database can survive, it is easier to increase the number of web servers, but once the database server fails, we have to cry. For general reports, I use stored procedures for packaging some complex result sets. I can find an ORM for general queries and cuid operations.

In fact, it is mainly about the weakness of the stored procedure.

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.