|
|
|
|
|
by matwood
1463 days ago
|
|
Destroy is a strong word (and UUIDs can certainly be sorted, but locality is an issue), but all of software is a series of tradeoffs. I've used both auto-increment and UUIDs, and wish I had used UUIDs in almost every case. Distributed generation - no sending a record to a server to get a key then using it to generate other records. In a world with increasing use of services, this becomes more important every day. System wide unique - helps with logging, debugging, and avoiding general errors. Multi-master db replication - I know this depends on the RDBMS, but having a unique key on every record avoids clashes. Also super useful during data migrations (which will happen. I have another rant that data always outlives code, so plan accordingly). Validation - UUIDs have a form that can be a first level validation on input. For me, those advantages outweigh some extra space usage, possible performance impact, and ugly URLs. And on performance, if it's determined that it is an issue because of using UUIDs there are ways to make them more index friendly. |
|