On my website I have a video page like youtube, I want to store data when a user visits the video page. The data I want to store is videoID, IP, referrer and date.
My concern is that I am not sure of the best way to store this data. One option I have thought about is MySQL and the other is in a CSV file. If I have lots of data which option would be the quickest to read the data from?
I can think about pros and cons for both options but what is your opinion? (Keeping in mind growth of the website). Also, are there any other viable options I have not thought about?
Note: I have thought about google analytics but this is not an option.
Use MySQL with the ARCHIVE storage engine. This will prove very time- and space- efficient for writing tonnage of log records, and will prove reasonably efficient for sequentially accessing the data for summarizing.
http://dev.mysql.com/doc/refman/5.0/en/archive-storage-engine.html
It's unsuitable for random access to the stored data. That kind of access will work, but will be absurdly slow.
But, think twice about re-inventing the flat tire. Google Analytics works very well indeed.