Saturday 17 December 2016

Is keeping static queries in the server good practice to limit queries?

Hey, I have been learning to program by creating a Nodejs site using express as the middle ware. I have done the bulk of it but I am now focusing on limiting the amount of queries to my MySQL db. My current setup is I have a 3 server async waterfall functions, they update the database with data from a webAPI, 1st one runs every minute, 2nd runs every day and 3rd one runs every week. Then in my express I have about 4 sql queries that are static (They aren't changed by user input) and another 4 that are changed by user input if they click a button. My question is, What is wrong or right with putting the static queries in my server and have them rerun constantly, and then just pass a variable with the data to my middleware? This will make users only do queries when they press the button to give custom information.ThanksEdit: I just learnt that it's called Raw SQL vs ORM, I will start researching this, will still appreciate comments on my specific situation. Thanks

Submitted December 17, 2016 at 08:15PM by Djinnes

No comments:

Post a Comment