title: Performance of MySQL Insert statements in Java: Batch mode prepared statements vs single insert with multiple values
body: <p>I am designing a <code>MySQL</code> database which needs to handle about 600 row inserts per second across various InnoDB tables.  My current implementation uses non-batched prepared statements.  However, writing to the <code>MySQL</code> database bottlenecks and my queue size increases over time.</p>
  
  <p>The implementation is written in Java, I don't know the version off hand.  It uses <code>MySQL</code>'s <a href="http://www.mysql.com/downloads/connector/j/" rel="noreferrer">Java connector</a>.  I need to look into switching to <code>JDBC</code> tomorrow.  I am assuming these are two different connector packages.</p>
  
  <p>I have read the following threads on the issue:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1774142/optimizing-mysql-inserts-to-handle-a-data-stream">Optimizing MySQL inserts to handle a data stream</a></li>
  <li><a href="https://stackoverflow.com/questions/20148/myisam-versus-innodb">MyISAM versus InnoDB</a></li>
  <li><a href="https://stackoverflow.com/questions/10139521/inserting-binary-data-into-mysql-without-preparedstatements">Inserting Binary data into MySQL (without PreparedStatement&#39;s)</a></li>
  </ul>
  
  <p>and from the mysql site: </p>
  
  <ul>
  <li><a href="http://dev.mysql.com/doc/refman/5.0/en/insert-speed.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/insert-speed.html</a></li>
  </ul>
  
  <p>My questions are:</p>
  
  <ul>
  <li><p>Does anyone have advice or experience on performance differences using INSERTs with prepared statements in batch mode vs. using a single <code>INSERT</code> statement with multiple VALUEs.</p></li>
  <li><p>What are the performance differences between the <code>MySQL</code> Java connector vs. <code>JDBC</code>.  Should I be using one or the other?</p></li>
  <li><p>The tables are for archive purposes, and will see ~90% write to ~10% read (maybe even less).  I am using InnoDB.  Is this the right choice over MyISAM?</p></li>
  </ul>
  
  <p>Thank you in advance for your help.</p>