websauna icon indicating copy to clipboard operation
websauna copied to clipboard

Consider using UUID primary key instead of secondary index

Open a3kov opened this issue 8 years ago • 2 comments

Need to evaluate the option of using UUID primary key everywhere.

a3kov avatar May 16 '17 13:05 a3kov

Pros:

  • ability to refer entities in distributed systems
  • ability to prepare data for conflict-free insertion
  • no need to depend on serial id in heterogeneous systems
  • saving storage space because UUID will replace redundant serial pk

Cons:

  • I've read that many years ago some DB engines could not implement UUID/GUID primary key index efficiently. However for modern engines this could be no longer the case. Need to check this, especially for proprietary engines such as Oracle and MS SQL Server

a3kov avatar May 16 '17 13:05 a3kov

Perf. optimization that could be a good idea also (haven't check its usefullness yet): https://groups.google.com/d/msg/sqlalchemy/uq3xPCmAmN8/YgMNQ6KGBgAJ

a3kov avatar May 20 '17 15:05 a3kov