0

I have few questions about using functions in a MySQL database for plugins and extensions of web apps like Magento or Wordpress. Mostly this is for a few extensions I want to do for Magento. The questions are:

  1. is it possible under normal average hosts out there, that functions can be added.
  2. (if 1) is it worth the effort to create function that would replace php in some manner (speed mostly is what I'm thinking)
  3. (if 1) can functions be looped? like timed or call to it's self x time like sleep or something.

I was wanting to use the db for simple things like removing rows that were older then or something like that. Examples are not as important as possibility here in my mind. This is more of a set of questions that are due to not every really seeing web app use functions, and it just seems like an area of untapped potential for optimization when designing web apps.

marc_s
9,0626 gold badges46 silver badges52 bronze badges
asked Jul 6, 2014 at 1:54

1 Answer 1

0

I can't answer to question 1 as I do not have enough information about the MySQL instances offered by different hosting providers.

To answer the rest of your questions, yes, if you can leverage the features of the RDBMS you're using, you might replace PHP code with SQL scripts that can run faster than your code. Just think about the time you're saving up by not transferring your data back and forth.

On the other hand you would probably still end up using PHP code or other programs (crontab or any other kind of scheduler) to run your timed tasks as there's no built-in scheduler in MySQL.

answered Jul 7, 2014 at 18:32
1
  • well there is events that can be created, but yes, the goal is not to replace php in hole, but to internalized things that would be faster to do with a query and store functions. I guess I'm left wondering why I never see web app use MySQL functions. Commented Jul 7, 2014 at 21:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.