title: INSERT DELAYED vs. Write-behind in PHP/MySQL
body: <p>What is the best way to avoid the overhead generated by executing many INSERT queries for logging purposes in a PHP/MySQL application? So far I have narrowed the solutions down to:</p>
  
  <ol>
  <li>Using the <strong>INSERT DELAYED</strong> statement. I have a suspicion this will actually be slower, considering there will be many writes and few reads to queue and merge them behind.</li>
  <li>Using a cache module supporting <strong>write-behind</strong>. However, it seems like there is no such module for PHP. This is also discussed here, though the answers are 3 years old and new technology has emerged since then: <a href="https://stackoverflow.com/questions/327035/how-to-implement-background-asynchronous-write-behind-caching-in-php">How to implement background/asynchronous write-behind caching in PHP?</a> </li>
  </ol>
  
  <p>Not losing log entries is important.</p>