title: How to Programmatically Pre-Split a GUID Based Shard Key with MongoDB
body: <p>Let's say I am using a fairly standard 32 character hex <a href="https://en.wikipedia.org/wiki/Globally_unique_identifier" rel="noreferrer">GUID</a>, and I have determined that, because it is randomly generated for my users, it is perfect for use as a shard key to horizontally scale writes to the MongoDB collection that I will be storing the user information in (and write scaling is my primary concern).</p>
  
  <p>I also know that I will need to start with at least 4 shards, because of traffic projections and some benchmark work done with a test environment.  </p>
  
  <p>Finally, I have a decent idea of my initial data size (average document size * number of initial users) - which comes to around ~120GB.  </p>
  
  <p>I'd like to make the initial load nice and fast and utilize all 4 shards as much as possible.  How do I pre-split this data so that I take advantage of the 4 shards and minimize the number of moves, splits etc. that need to happen on the shards during the initial data load?</p>