3 ms·
you increment your database ID for each row... 9-10 is natural for numbers but doesn’t flow for strings. making the number into a string is pointless because it
by rickycook 8y ago
you increment your database ID for each row... 9-10 is natural for numbers but doesn’t flow for strings. making the number into a string is pointless because it always starts it’s life as a number
- yen223 8y agoWhat I find most of the time is that you only need IDs to be unique. The fact that databases use auto-incrementing integers to ensure uniqueness is an implementation detail, and not a strictly necessary one (think UUIDs).
- ryanbrunner 8y agoRight, but I think the main point is if you're going to use auto-incrementation to provide values for your IDs, you might as well use numbers, since at that point you are doing math on them (one super simple operation of "+1", but math nonetheless.)
- dalore 8y agoIf you use UUIDs you can have clients distributed around generate IDs for the db before they even save, no need for a +1 centralized id mechanism. That becomes a bottleneck.