Guids and INDIGO

Guids and INDIGO

Old forum URL: forums.lhotka.net/forums/t/87.aspx


tsaltd posted on Saturday, May 13, 2006

I'm currently planning a new database platform and am doing due dillegence on the suitability of GUIDS as primary keys in that database.

One question that I'm wondering about is the strategic importance of using GUIDs within WCF.

Any pointers to info on this subject will be appreciated.

Thanks,

Steve

RockfordLhotka replied on Saturday, May 13, 2006

Depends on how you are using WCF.

If you are using it as a transport for the data portal then there's no difference between WCF and Remoting or Enterprise Services today - it is just another RPC protocol.

However, if you are using it to build true service-oriented systems, then Guid values can be very useful. Remember that messages must be uniquely identified, so a given message can be repeated without the service actually repeating the work (part of being idempotent). Guids can be a useful tool in accomplishing this - though I do think there are better techniques (ascending message ids for instance).

ward0093 replied on Saturday, May 13, 2006

I actually started one of our DBs here with a UNIQUE ID (Incremented INT's)... and I had it change them all to GUIDs because of a couple of reasons (i should note... I am huge fan of GUIDs because of the Global ability they allow).

First Reason... we have a couple of databases that need to be uploaded to a central database so GUIDS allow global identification. 

Second Reason... in our Middle Tier (our CSLA BOs) we can actually create the ID in our app and pass it to the Database... if you allow the database to create that new ID (from incrementing) than you have to have a second process in your DataAccess Layer (DataPortal_Insert more importantly) for setting your BO Properties to the new values returned from your INSERT Call... This was a really problem for me... so now, with GUIDs, I can fire my SDR.ExcuteNonReader and mark the object as MarkAsOld and that is it!

Anyways... I know this was short but USE GUIDS!! it is much easier and your performance hit is minimal compare to your UNIQUE ID (Incrementing INT) implementation.

ward0093

Copyright (c) Marimer LLC