title: Alternative to GUID with Scalablity in mind and Friendly URL
body: <p>I've decided to use GUID as primary key for many of my project DB tables. I think it is a good practice, especially for scalability, backup and restore in mind. The problem is that I don't want to use the regular GUID and search for an alternative approach. I was actually interested to know what Pinterest i using as primary key. When you look at the URL you see something like this:</p>
  
  <pre><code>http://pinterest.com/pin/275001120966638272/
  </code></pre>
  
  <p>I prefer the numerical representation, even it it is stores as string. Is there any way to achieve this?</p>
  
  <p>Furthermore, youtube also use a different kind of hashing technique which I can't figure it out:</p>
  
  <pre><code>http://www.youtube.com/watch?v=kOXFLI6fd5A
  </code></pre>
  
  <p>This reminds me shorten url like scheme.</p>
  
  <p>I prefer the shortest one, but I know that it won't guarantee to be unique. I first thought about doing something like this:</p>
  
  <pre><code> DateTime dt1970 = new DateTime(1970, 1, 1);
   DateTime current = DateTime.Now;
   TimeSpan span = current - dt1970;
  </code></pre>
  
  <p>Result Example:</p>
  
  <pre><code>1350433430523.66
  </code></pre>
  
  <p>Prints the total milliseconds since 1970, But what happens if I have hundreds thousands of writes per second. </p>
  
  <p>I mainly prefer the non BIGINT Auto-Increment solution because it makes a lot less headache to scale the DB using 3rd party tools as well as less problematic backup/restore functionality because I can transfer data between servers and such if I want.</p>
  
  <p><strong>Another</strong> sophisticated approach is to tailor the solution towards my application. In the database, the primary key will also contain the username (unique and can't be changed by the user), so I can combine the numerical value of the name with the millisecond number which will give me a unique numerical string. Because the user doesn't insert data as such a high rate, the numerical ID is guarantee to be unique. I can also remove the last 5 figures and still get a unique ID, because I assume that the user won't insert data at more than 1 per second the most, but I would probably won't do that (what do you think about this idea?)</p>
  
  <p>So I ask for your help. My data is assumes to grow very big, 2TB a year with ten of thousands new rows each second. I want URLs to look as "friendly" as possible, and prefer not to use the 'regular' GUID.</p>
  
  <p>I am developing my app using ASP.NET 4.5 and MySQL</p>
  
  <p>Thanks.</p>