anhtran
anhtran

Reputation: 2034

Read/Write File vs. Query Database

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?

Upvotes: 0

Views: 1367

Answers (2)

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

Upvotes: 1

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.

Upvotes: 1

Related Questions