Welcome Guest, Not a member yet? Register   Sign In
MySQL load VS Server CPU load
#1

[eluser]vecima[/eluser]
Hi everyone,

To start, I'm working on a blog application. I started off with the "Blog in 20 minutes" example video (that was long ago). I've added lots of advanced features. Specifically for this question, I've given users the ability to rate blog posts with a 5 star rating system, and the ability to comment (of course).

Now, When displaying the blog, I have a side bar area with extra helpful navigation links. 2 new ones I'm working on are "Highest Rated" and "Most Commented" areas. Each of these shows the 3 blog posts that have the highest 5 star rating, or the most comments, respectively.

I also have sections that list the tags/categories, and a section that acts as an archive - you can view articles from 2010, 2009, or you can "expand" one of the years, and pick the articles from a specific month.

My question is this:
Is it better to query for the needed data separately for each of these side areas (keeping in mind that I'm going to turn on database caching at some point)? Or is it better to do one query that gives me everything I need for the whole sidebar, and do various sort procedures on the data to get the lists I need to populate each area individually? It seems to me like doing individual queries might be excessive load/queries on the MySQL, but It also seems like sorting one query several times (sorted by rating, sorted by comment count, sorted by time stamp) might be excessive on server load.

Since I'm planning on using database caching, I'm thinking of leaning toward the query heavy implementation, but I wanted to see if anyone with more experience or knowledge had a feel for this.

I hope I've explained this clearly enough! Let me know if you need me to elaborate, and thanks in advance!
#2

[eluser]n0xie[/eluser]
How many visits/day do you get? If it's anything under 10.000 I wouldn't worry either way. MySQL can handle a lot of load before it comes crashing down.




Theme © iAndrew 2016 - Forum software by © MyBB