title: How to generate a time-ordered uid in Python?
body: <p>Is this possible? I've heard Cassandra has something similar : <a href="https://datastax.github.io/python-driver/api/cassandra/util.html" rel="noreferrer">https://datastax.github.io/python-driver/api/cassandra/util.html</a></p>
  
  <p>I have been using a <code>ISO timestamp</code> concatenated with a <code>uuid4</code>, but that ended up way too large (58 characters) and probably overkill.</p>
  
  <p><strong>Keeping a sequential number doesn't work in my context</strong> (DynamoDB NoSQL)</p>
  
  <p>Worth noticing that for my application it doesn't matter if items created in batch/same second are in a random order, as long as the <code>uid</code> don't collapse.</p>
  
  <p>I have no specific restriction on maximum length, ideally I would like to see the different collision chance for different lengths, but it needs to be smaller than 58 (my original attempt)</p>
  
  <p>This is to use with DynamoDB(NoSQL Database) as Sort-key</p>