I know this thread has been discussed before, but I have run into this problem and would like to re-open it... I have come to a point in my project where I need to provide an import/export feature for Active Records. Since a user could export off one system and import onto another auto-increment integers will not work (collisions on ids due to lack of uniquness). Listed below is an initial list of pros/cons. Please add items as you see fit, if the pros out weigh the cons and DHH agrees then I will submit a patch to add GUID support. Pros: Unique key across multiple databases Could help for migrating blogs between Typo instances (not sure if they tackle this problem currently) Cons: Ugly URLs Slower DB lookups Josh
> Listed below is an initial list of pros/cons. Please add items as you > see fit, if the pros out weigh the cons and DHH agrees then I will > submit a patch to add GUID support.I for one would love to see this as an inbuilt, easy to turn on option in Rails. I think whether you go with auto-incremented IDs or GUIDs depends largely on the specific application, but sometimes GUIDs can make more sense so it''d be a great feature to have. Ben
On Thursday 19 May 2005 03:16 pm, Josh Knowles wrote:> > Cons: > Ugly URLs > Slower DB lookupsDepends on application scale and how you generate your GUID. If by GUID, you mean a Windows style generated GUID, I''ll agree with you. But in some applications, it is reasonably to generate 64 bit numeric ID that is segmented into "Hi/Lo", (or some more complex scheme), and then objects can have IDs before they''re persisted, which can be important. And it''s not slow nor particularly ugly.
Josh Knowles wrote:> Pros: > Unique key across multiple databasesYup, we do this often. We will have similar data in more than one database that we will merge together for user manipulation. Integer IDs don''t cut it - we use windows style GUIDs. xev