1

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.

4

1 回答 1

2

将 MySQL 与 ARCHIVE 存储引擎一起使用。这对于写入大量日志记录将证明非常节省时间和空间,并且对于按顺序访问数据以进行汇总证明是相当有效的。

http://dev.mysql.com/doc/refman/5.0/en/archive-storage-engine.html

它不适合随机访问存储的数据。这种访问会起作用,但速度会慢得离谱。

但是,请三思而后行重新发明瘪胎。谷歌分析确实很好用。

于 2013-08-12T13:14:41.457 回答