I saw GUIDs that were used as primary keys quite recently, and I think this is a terrible idea. A GUID means โglobally unique identifier,โ that is, an identifier whose likelihood of replication is to misinterpret Brockmeyer in his OLE book โas likely as a bunch of atoms rushing together in empty space all the time to form a small nut.โ
There are good reasons to use a GUID if you really need something globally unique, but most database keys should be unique relative to a given database. In this case, the often-generated sequential integer key is often sufficient, and it consumes much less resources. In fact, neither sequence identifiers nor GUIDs have any inherent meaning, so itโs better if you can use elements that really really identify the object in question as a primary key, if you can (although there is a school of thought that says all the elements must have a content-independent key, such as a sequence or even a GUID).
Battles have several obligations as primary keys. As already mentioned, you can decide that you need extra bits. You may encounter collisions. Databases are generally poorly bit-wise and cannot be migrated even then. Finally, indexing algorithms for the database of your choice may not be able to optimize bit keys well.
source share