PHP page counter, VS database-based file. Which one is better?

as the name of the question says, my question is simple, which is better in terms of performance, knowing that I am on a Linux hosting, on site. I am able to encode both, I actually encoded one that updates the database, but from reading around some people are encouraged to insert and not update .. any feedback is greatly appreciated.

thank.

+3
source share
2 answers

Use the database! Since you will have several users who access your site, writing to one file will mean blocking or overwriting the counter.

, , . , select count(*) from countTbl

+1

? ( ), , , - .

0

Source: https://habr.com/ru/post/1731473/


All Articles