title: Storing elements in an unordered_set vs storing them in an unordered_map
body: <p>Suppose I have the following User struct:  </p>
  
  <pre><code>struct User { 
      string userId; 
      UserType userType; // UserType is just an enumeration
      string hostName;
      string ipAddress;
      //and more other attributes will be added here
  
  };
  </code></pre>
  
  <p>and I need to store a collection of user records (around 10^5 users, can scale higher too ). Would it be better in performance if I store it as an unordered_set or unordered_map? Unordered_set is technically the same as HashSet, and unordered_map is the same as HashMap, right? Using a regular set (ordered) is not an option, as insertion and deletion will get very slow when the number of elements increase.</p>
  
  <pre><code>unordered_set &lt;User&gt; userRecords;
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>unordered_map &lt;string, User&gt; userRecords; // string is the user ID.
  </code></pre>
  
  <p>I need it to be very fast in terms of insertion, deletion, and to access a particular user object by its userId.</p>