Frequent Database Posting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
haptic
Forum Newbie
Posts: 11
Joined: Fri Sep 08, 2006 7:21 pm

Frequent Database Posting

Post by haptic »

Hi, I have a concept for tracking a users visit to my flash site, and it would require information to be posted to a mySQL database frequently. Each time they click on a project it will post the amount of time they spent on the last project. I would say the average visitor to my site would probably make about 2-8 posts in the span of 2-8 minutes. Currently my site receives around 100 sessions/day, but this is expected to increase soon. Will this procedure be a problem for my database, bandwidth or server? is there a better method to retrieve this information?

ultimately this data will be utilized in a 3-dimensional bar graph, displaying project views, duration spent, and votes for favorites. The site this will be implemented into is http://www.haptic-data.com and under "post analysis" is a beta (xml-only) version of the dynamic graph.

Thank you!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Let's do some math: assuming an average number of posts per visitor is 5 and that you'll hit 500 sessions per day. That's averaging one post per 34.5 seconds.

That is a VERY light load for a database.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

MySQL has a database engine that is optimized for temporary data but I forget what it is called and how it works.
haptic
Forum Newbie
Posts: 11
Joined: Fri Sep 08, 2006 7:21 pm

Post by haptic »

thanks for the help. Will sending this information to the database cause a major increase to my server's bandwidth?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

For the most part, not much. It depends on how much data you submit for each request.

Technically it's often possible to do all the calculations on the server using sessions. However this can get a tad bit murky if users open multiple tabs/windows.
haptic
Forum Newbie
Posts: 11
Joined: Fri Sep 08, 2006 7:21 pm

Post by haptic »

Thats a good point, I hadn't really thought about using sessions, maybe thats something I will integrate later if problems arise. Thanks for your help, I really appreciate it! I think I have all the information I need to get this project started.
Post Reply