3 ms·
Most projects can reasonably and usefully stick with central ID allocation forever. And even if you want to decentralise ID allocation, so long as you still ha
by chrismorgan 4y ago
Most projects can reasonably and usefully stick with central ID allocation forever.
And even if you want to decentralise ID allocation, so long as you still have control over the nodes, you can still use roughly sequential identifiers if you choose, by multiplying by some standard value and offsetting the sequence by a node ID. You could reserve ten least significant bits for a node ID, for example, allowing up to 1024 nodes to generate IDs. So node 0 would allocate IDs {0, 1024, 2048, …}, node 1 {1, 1025, 2049, …}, &c. This requires more planning and possibly more maintenance, but will have the advantage of producing shorter IDs which can be highly desirable.
Random IDs do have a place, but they’re massively overrated. The length required to control the collision risk is very significant.