title: Should I generate UUID's in application or in the database?
body: <p>PostgreSQL will be used in production and it has native support for UUID's.</p>
  
  <p>But how should I handle generation of them?</p>
  
  <p>Currently I use following:</p>
  
  <pre><code>uuid = Column(UUID, primary_key=True, default=lambda: uuid4().hex)
  </code></pre>
  
  <p>With this they are generated by the application.</p>
  
  <p>Would it be a performance improvement if the database generates them and how could I implement that?</p>