title: Using GUID's as folder names + splitting up
body: <p>I want to use GUID's (uuid) for naming folders in a huge file store. Each storage item gets his own folder and guid. 
  The easiest way would be "x:\items\uuid\{uuid}..."<br>
  example: "x:\items\uuid\F3B16318-4236-4E45-92B3-3C2C3F31D44F..."</p>
  
  <p>I see here one problem. What if you expect to get at least 10.000 items and probably a few 100.000 or  more then 1 million. I don't want to put so many items (sub folders) in one folder.</p>
  
  <p>I thought to solve this by splitting up the guid. Taking the 2 first chars to create sub folders at the first level and the take the next 2 chars and also create sub folders.
  The above example would be -->  "x:\items\uuid\F3\B1\6318-4236-4E45-92B3-3C2C3F31D44F..."</p>
  
  <p>If the first 4 chars of guid's are really as random as expected then I get after a while 256 folder within 256 folders and I always end up with a reasonable amount of items within each of these folders
  For example if you have  1 million items then you get --> 1 000 000 / 256 /256 = 15.25 items per folder</p>
  
  <p>In the past I'v already tested the randomness of the first chars. (via vb.net app). Result: The items where spread quit evenly over the folders.
  Also somebody else came to the same conclusion. see <a href="https://stackoverflow.com/questions/13149139/how-evenly-spread-are-the-first-four-bytes-of-a-guid-created-in-net">How evenly spread are the first four bytes of a Guid created in .NET?</a></p>
  
  <p><strong>Possible splits I thought of</strong> (1 million items as example) 
  C1 = character 1 of GUID, C2 = character 2, etc</p>
  
  <blockquote>
    <ul>
    <li>C1\C2\Rest of GUID  -->  16 * 16 * 3906 (almost 4000 are still al lot of folders) </li>
    <li>C1\C2\C3\C4\Rest of  Guid --> 16 * 16 * 16 * 16 * 15 ( unnecessary splitting up  of folders)</li>
    <li><strong>C1C2\C3C4\Rest of  Guid --> 256 * 256 * 15 (for me the best option ?)</strong></li>
    <li>C1C2C3\Rest of  Guid --> 4096 * 244 (to many folders at first level??)                </li>
    <li>C1C2C3C4\Rest of Guid --> 65536 * 15 (to many folders at first level!)</li>
    </ul>
  </blockquote>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Does anyone see drawbacks for this kind of implementation. (scheme: *C1C2\C3C4\Rest of  Guid)</li>
  <li>Is there some standard for splitting up Guids, or a general way of doing this.</li>
  <li>What happens if you put a few 100 thousands of sub folders in one folder (I still prefer not to use any splitting if possible)</li>
  </ul>
  
  <p>Thanks, Mumblic</p>