title: Which data structure to use for storing big amount of strings
body: <p>Well, to explain the problem-question...</p>
  
  <p>I have:<br>
  One Big DB table filled with millions of entries (each entry may have an "n" amount of columns).</p>
  
  <p>The concept: </p>
  
  <p>I want to show to a web interface two lists (ex. "Available" and "Selected").
  When a user moves an entry from one list to the other I need to store temporary the unique-id (type of string) of the entry to an "Unknown data structure" named "selected" in my server and when the user finally clicks submit I will pass this list further to an other application.</p>
  
  <p>Sorting and filtering are done into the DB and then the full amount of data (in chunks) is loaded back to java, then every entry will be checked if it is selected and will be added to the list that is going to be displayed in the web interface.</p>
  
  <pre><code>for each entry{
    if(selected.contains(currentEntry.ID)){
      selectedList.add(currentEntry)
    }else{
      availableList.add(currentEntry)
    }
  }
  </code></pre>
  
  <p>The lists selectedList and availableList will only hold few hundreds of entries (those that are displayed to the user, approximately a page with max 100-200 entries) so a list of type "entry" is good enough and holds my sorting.</p>
  
  <p>The problem:<br>
  The structure "selected" must hold many thousands of ids (some times it may reaches million(s)). </p>
  
  <p>The need:<br>
  I need fast access to find if the id exists (structure.contains(id)) so for sure I will use a hash structure.
  I need the structure that will use the minimum Memory resources.</p>
  
  <p>The non-need:<br>
  Good performance on deletion is not needed. Sorting is not needed.</p>