If you really need to do this yourself, you should go with the sqlite method. Despite the small overhead (due to opening the database file), there can also be significant advantages when storing structured data.
You can, for example, add a date field, and then receive daily / hourly / monthly / any data for each page.
You can also add an IP address for each visitor, and then retrieve the visit data. This way, you can easily extract user behavior data for your site.
You can also save the user agent and your visitor so that you know which browsers you should target or not.
, . , . , , , .