views:

18

answers:

2

My website has a large number of readers every day. I wanted to track the traffic of each article. For each visitor, I added a unit on the counter. I'm confused between two solutions:

  1. Saved to a file on the server. Create the cron jobs to update them on the database.
  2. Save directly to database.

Should I do now?

+1  A: 

I will choose 1 approach, for best result You could save that file on some other hard disc. You must remember that when you observe something, that observation have influence on the result, so to have more reliable result you should minimize this influence.

For working with data you can easily later import them to database.

Vash
+1  A: 

What about a memorydatabase? Memcached or something. No disk-impact and speedy..

Christian W
I've used Memched. My database is MySQL.
Tran Tuan Anh