First of all sorry for the wall of text :S
Ok, here is my problem. I'm building a web app with codeigniter and mysql. Main thing will be that ppl will leave posts, other will rate it, leave comments etc. Now, when i think of it, doing update to database on every single vote up/down is pretty supid, right? I mean what if 500+ ppl are on site and they are reading + voting posts... that would crash my site like instant (or would it, i rly don't know), since I would have so many queries for every single vote up/down. So, my question is, how to solve this? Some global associative array to store id of the post as a key and +1/-1 as a value? And than some sort of "timed sql query" (if there is such thing?) to update votes lets say every 2 or 5 mins or so, and just "refresh" vote counter with ajax until I update database? Basically I'm thinking best performance in case my site goes boom :P. Can it be done with page caching or idk?
2nd issue is that u won't have to register to leave post/vote other post (i have figured everything about it, u can't post spam/garbage), but the main issue for me is how to limit one vote per post per user, since they are guests? What i googled out (was very vague) is presistent cookies, so is it the way to go or no?
I'm not asking for sample codes, just for some guide lines what to research, how to approach the problem, where to look, to get a solution. If u have some suggestions on how to solve this, it would be VERY appreciated.
Thank you, and again, sorry for the wall of text.