title: Loading facebook's big text file to memory (39MB) for autocompletion
body: <p>I'm trying to implement part of the facebook ads api, the auto complete function <a href="https://developers.facebook.com/docs/reference/rest/ads.getAutoCompleteData" rel="nofollow">ads.getAutoCompleteData</a></p>
  
  <p>Basically, Facebook supplies this 39MB file which updated weekly, and which contains targeting ads data including colleges, college majors, workplaces, locales, countries, regions and cities.</p>
  
  <p>Our application needs to access all of those objects and supply auto completion using this file's data.</p>
  
  <p>I'm thinking of preferred ways to solved this. I was thinking about one of the following options:</p>
  
  <ol>
  <li>Loading it to memory using Trie (<a href="http://code.google.com/p/patricia-trie/" rel="nofollow">Patricia-trie</a>), the disadvantage of course that it will take too much memory on the server.</li>
  <li>Using a dedicated search platform such as <a href="http://lucene.apache.org/solr/" rel="nofollow">Solr</a> on a different machine, the  disadvantage is perhaps over-engineering (Though the file size will probably increase largely in the future).</li>
  <li>(Fill here cool, easy and speed of light option) ?</li>
  </ol>
  
  <p>Well, what do you think?</p>