Stored procedures a no-go in the php/mysql world?

前端 未结 10 1722
粉色の甜心
粉色の甜心 2020-12-29 06:53

I\'m quoting part of an answer which I received for another question of mine:

In the PHP/MySQL world I would say stored procedures are no-go

10条回答
  •  青春惊慌失措
    2020-12-29 07:16

    I develop and maintain a large PHP/MySQL application. Here is my experience with stored procedures.

    Over time our application has grown very complex. And with all the logic on the php side, some operations would query the database with over 100 short queries.

    MySQL is so quick that the performance was still acceptable, but not great.

    We made the decision in our latest version of the software to move some of the logic to stored procedures for complex operations.

    We did achieve a significant performance gain due to the fact that we did not have to send data back and forth between PHP and MySQL.

    I do agree with the other posters here that PL/SQL is not a modern language and is difficult to debug.

    Bottom Line: Stored Procedures are a great tool for certain situations. But I would not recommend using them unless you have a good reason. For simple applications, stored procedures are not worth the hassle.

提交回复
热议问题