View Single Post
Old 03-18-2022, 07:56 AM  
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by TACNet View Post
For scaleablitiy, I'd be careful about writing your data directly to your MySql tables

We had the same issue when putting together our affiliate tracking scripts. It only takes one bot to start hammering your pages and it will down your DB server

We found a far better approach is to write everything to a log file first and then setup a cron script to process that log file every 15 minutes or whatever. That way you can filter out duplicates, bot scripts etc etc

Hope that helps
With that reasoning, it would be better to use a mysql memory table as a buffer and insert into that, as if you are inserting into a log file you will have several issues.
- Constant IO Writes
- Write-locks on the log, since only 1 process can write to it at once.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote