Log to file via PHP or log to MySQL database - which is quicker?

前端 未结 15 1281
故里飘歌
故里飘歌 2021-02-03 11:07

I have a database driven website serving about 50,000 pages.

I want to track each webpage/record hit. I will do this by creating logs, and then batch processing the logs

15条回答
  •  遇见更好的自我
    2021-02-03 11:27

    I'd recommend you test both with a few test cases.

    I would assume a flat file would be faster, b/c that's really what the DB is doing - it's just writing it to a file. The only advantage I can think of is if the database can run concurrently, you might get better results.

提交回复
热议问题