Reputation: 503
I'm looking at creating a basic Analytics page to learn more information about Javascript, AJAX and alternative data storage types such as redis. My question today is, what is the best way to serve the user data? Should it always be calculated on the fly, such as graphs and charts, or should cron jobs be run every hour (?) to generate the data in JSON then when the page loads it can parse that data?
Upvotes: 0
Views: 82
Reputation: 3302
This is dependent on what you want to create in the end.
Anyway, when doing a mainly educational project I think it's best to just focus on creating. Just do it whatever way you find easiest to make it do what you want. After a while when you've got a couple of features together and are perhaps using it somewhere you'll probably get abit annoyed that some thing is rather slow and you'll take care of it. In addition, that table would be so much more cleaner to display as a chart. And so on. By then you'll have both motivation and some experience.
Upvotes: 1