I'm currently building a NodeJS application and I was wondering what the best way of storing data was.
Currently I'm querying my MySQL database when the application is started then putting the data into JS arrays. Then periodically every 5 mins or so it is looped though and updated in MySQL if the data has changed.
Now I was wondering for example I have a database table of 'people' and I load all the rows into an array 'APP.PEOPLE'. Now if I want to get one person using an id i have to loop trough the whole array is it better to just re-query the database or just loop it?
via user2716281
No comments:
Post a Comment