Before MySQL provides this new feature, MySQL developers need to store their procedures on the application, there hasn’t been an option anyway. And now, this new feature is available on version 5.0, and I am going to discuss why we would want to use stored procedures and place logic on the database server, instead of just put the procedures on the application.
Why use Stored Procedures?
§ They can run in all environments. Since stored procedures are stored in database server, so it doesn’t matter what application environment is used – the logic just remains in one place.
§ Less network traffic. For complex application, it may require complex queries or looped queries to get the desired result; it may generate more network traffic than it should be. By using Stored Procedures, they can cut down the unnecessary long queries being sent back and forth from application and database server, since they are done on the database server.
§ You can fix problems in your application by simply edit the related stored procedures on your database server, instead of changing your application code.
§ Speed of execution. Data manipulation that is done directly on the database server is faster than your application to handle it.
0 comments:
Post a Comment