Hi guys,
I want to count the hits I'm sending to various links. It's pretty easy to do but I'm still not sure about something. I'm presumming it would be faster to store the counts in a database rather than a flat file, does that mean I have to make the connection, access the data, increment it, then close the connection every single time someone clicks a link I am counting ?
I am a pro at C(++) so programming comes easy to me but I'm a little rusty on database stuff.
It just seems like a lot of overhead to maintain and increment some integers.
So am I on the right track here ?
Any guidence would be appreciated.
Thanks.
General Considerations for Click Counter
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
that's the typical way.. Connecting to a database is rather simple for most protocols. For instance, the average phpbb page makes one database connection and 10 or more queries before completing the page.
Unless you are doing very large hit counts, don't worry about it too much. You can use connection pooling and/or persistant connections to offset the connection time if you feel it's too high...
Unless you are doing very large hit counts, don't worry about it too much. You can use connection pooling and/or persistant connections to offset the connection time if you feel it's too high...