Why use GUID primary keys?
To fulfill Ubik’s goal of predictability, it is necessary that newly-created objects are indistinguishable from those stored in the database. If a piece of client code uses an object/its identity to form a query, then that identity needs to be distinct from that of all other newly-created objects. The fact that an object does not change its identity during its lifetime (as it would if its identity were generated upon database insertion) also helps to keep behaviour consistent. Another worthwhile benefit of using GUIDs is that they make it possible that transparent online/offline smart client support could be added to Ubik without a great deal of additional complexity. Space/performance considerations need to be made on a project-by-project basis, however they don’t usually preclude using GUIDs – consider that 1,000,000 GUIDs take approximately 16 MB of storage, compared to 4 MB for integers. These are both small numbers when considering filesystem storage on a modern server.