websauna
websauna copied to clipboard
Consider using UUID primary key instead of secondary index
Need to evaluate the option of using UUID primary key everywhere.
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
Perf. optimization that could be a good idea also (haven't check its usefullness yet): https://groups.google.com/d/msg/sqlalchemy/uq3xPCmAmN8/YgMNQ6KGBgAJ