You want Gearman - it will queue queries and insert them as and when the database is ready for them, so you do not overload the database server.
Gearman provides a general framework application for working with other machines or processes that are better suited to the job. This allows you to do parallel work, load balance processing and call functions between languages. It can be used in various applications, from high-availability websites to replicating events database replication. In other words, it is the nervous system for distribution that processes the message. Some strengths about Gearman:
A recent (and quality) post about using databases for registration here , which (in short) says:
- Use MyISAM with parallel inserts
- Rotate the tables daily and use UNION to query
- Use delayed inserts with MySQL or a job-processing agent such as Gearman (although MySQL has a limit on the number of them, it will queue before silently dropping them!)
HighScalability write to Gearman .
If you really want to avoid this, you can write the original SQL statements to a file and process them using this cronjob:
mysql loggingDB logTable < fullLog.sql && > fullLog.sql
source share