How do you think about when to use machine-generated IDs (such as UUIDs) versus human-readable IDs (such as Github organization / repo names)?<p>I'm specifically thinking about when to use these different types of IDs in APIs, API routes, and in your database. Assume that we could enforce uniqueness for human-readable IDs on a global or tenant basis.
Both.<p>UUIDs require much less storage/memory than string keys, and you can create offline bulk inserts quickly and easily with them.<p>Make your table with UUIDs as the primary keys, and then create a unique, human-readable lookup key as an additional column.<p>This gives you the best of both worlds.
Uuids have next to no chance for duplicates and are safe for usage in all languages.
integers can cause problems if your system that use the numeric ids use the wrong type.
you can run into this with javascript, which can cause problems. Integers can also cause problems with databases, mysql splits the space of possible ids between all servers in a cluster. So when one db server is more used for creating records you are wasting space.
integers can also create problems if the datatype is too small.
It's not an either/or question, it's a "what is your use case?" question. Why do they need to be human-readable? If there are security aspects, you need quality cryptographically-strong randomness as well as unguessability.