3 ms·
Since there is some UUID hate here, some missing pros to using them: - No round trip for generating keys, data can be sent in with an existing or new uuid with
by drawkbox 10y ago
Since there is some UUID hate here, some missing pros to using them:
- No round trip for generating keys, data can be sent in with an existing or new uuid without having to hit the autonumber/keymaster, removes a single point of failure for a small fee on each row. Storage is cheap so 16-byte uuid is not a deal-breaker, the benefit is speed and horizontal scalability. Optimized read-only tables and/or caching can be made where this has any impact at all.
- Some databases like Oracle you need a sequence to even do autoumbering, huge pain
- Autonumbering is a pain when having to replicate across environments or when you start getting multiple databases and clusters
- Numeric ids for important data is not exposed, prevents easily incrementing for next/previous (other ways to do this but this is one)
- Many databases have a UUID field or field optimized for unique ids/guids/uuids now
- If you were a piece of data wouldn't you want to be unique? All your data are unique snowflakes with UUIDs. On a serious note, this can help to identify data across all types and not just in the same table.
- insulanian 10y agoYou're optimizing for write, but the performance gain is negligible in comparison to the performance loss due to index fragmentation and slow joins. Also, on "storage is cheap": http://www.sqlskills.com/blogs/kimberly/disk-space-is-cheap/ http://www.sqlskills.com/blogs/kimberly/disk-space-is-cheap/