Editor and UUID primary keys?

Editor and UUID primary keys?

weedenbweedenb Posts: 25Questions: 6Answers: 0

I've been thinking about switching to UUID primary keys instead of sequence id's. Just a general question of anybody doing this and what problems if any need addressed? It doesn't appear to me that Editor really cares what you use as the primary id as long as its unique. As it uses an internal index anyway it seems that there shouldn't be a performance hit either? I'm guessing I'll need to do a getter and a setter on the server scripts to convert back and forth between the DB internal 128 bit data type (I'm using Postgres) and the javascript string representation? Main motivation here is the use of multiple remote databases and the need to manage primary keys across all of them in a simple way. Alternative is to simply assign different sequence ranges on each db but it seems I might live to regret that some day as it scales out. Am I missing anything or is this just a dumb idea to begin with?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Editor will work just fine with a UUID (both client-side and the server-side libraries). The only thing you need to remember is to make sure that you have a trigger to insert a new UUID when the new row is created.

    I doubt there will be any noticeable impact on performance. I've been using UUIDs for a recent project and it doesn't present any issues.

    Allan

  • weedenbweedenb Posts: 25Questions: 6Answers: 0

    Thanks very much Allan, that's good news to hear. This will make things much easier. No more messing about with sequence functions, yahoo!!

This discussion has been closed.