title: Solr vs. MySQL performance for autocomplete
body: <p>In one of our applications, we need to hold some plain tabular data and we need to be able to perform user-side autocompletion on one of the columns.</p>
  
  <p>The initial solution we came up with, was to couple MySQL with Solr to achieve this (MySQL to hold data and Solr to just hold the tokenized column and return ids as result). But something unpleasant happened recently (developers started storing some of the data in Solr, because the MySQL table and the operations done on it are nothing that Solr can not provide) and we thought maybe we could merge them together and eliminate one of the two.</p>
  
  <p>So we had to either: (1) move all the data to Solr (2) use MySQL for autocompletion</p>
  
  <p>(1) sounded terrible so I gave it a shot with (2), I started with loading that single column's data into MySQL, disabled all caches on both MySQL and Solr, wrote a tiny webapp that is able to perform very similar queries [1] on both databases, and fired up a few JMeter scenarios against both in a local and similar environment. The results show a 2.5-3.5x advantage for Solr, however, I think the results may be totally wrong and fault prone.</p>
  
  <p>So, what would you suggest for: </p>
  
  <ol>
  <li>Correctly benchmarking these two systems, I believe you need to
  provide similar[to MySQL] environment to JVM. </li>
  <li>Designing this system.</li>
  </ol>
  
  <p>Thanks for any leads.</p>
  
  <p>[1] <code>SELECT column FROM table WHERE column LIKE 'USER-INPUT%'</code> on MySQL and <code>column:"USER-INPUT"</code> on Solr.</p>