Home  /  Questions  /  Question



50   50
Aug 13, 2014


Is it possible to use Guid as a primary key?

We're developing a system as a high availability solution, using ADO.NET Sync Services for a database replication. This means that the primary key on tables should not be auto-increment integer, we will probably use Guid instead. 

Deciding which architecture to use I wonder if Spark or Patterns Framework solution can be modified to support this scenario? 

Thanks,
Martin



508   99.9
Aug 18, 2014
Hello Martin:

Currently, the SPARK platform does not  formally support GUID as primary key.  
The reason it that in almost all situations it is better to use int or long rather than GUID.

However, there are some (distributed) situations in which GUID is a reasonable option.
We are currently reviewing whether GUID primary keys will be supported in the next release.

Hope this helps.


50   50
Aug 24, 2014
Hi, 

I think you should not use GUID as the primary since they make database very slow over time.
instead continue using GUID for uniqueness purpose then used number as primary key. 


regards,
MMM

50   50
Aug 26, 2014
Hi Jack,

Hope this support will be included in future releases, it would really expand the list of scenarious where this product can be used. Now we choosed to go with EF 6.

Mike - I'm aware of performance impact that this concept can bring up later, but we'll stick with it, using sequential generated keys to reduce it to minimum.

Thanks,
Martin