I am developing a fairly complex system. One of our main concerns is SQL Server peer-to-peer replication support. The idea is to support multiple geographically separated nodes.
The second problem is the use of modern ORM in the middle level. Our first choice has always been the Entity Framework, mainly because developers like to work with it. (They love LiNQ support.)
So the problem is:
Given peer-to-peer replication, I decided to use a uniqueidentifier with a default value of newsequentialid () for the primary key of each table. This seemed to provide a good balance between preventing key collisions and reducing index fragmentation.
However, it turns out that the current version of the Entity Framework has a very strange limitation : if the object key column is a unique identifier (GUID), then it cannot be configured to use the default value (newsequentialid ()) provided by the database. The application layer should generate a GUID and populate the key value.
So here is the debate:
- abandon Entity Framework and use another ORM:
- use NHibernate and give up LiNQ support.
- linq2sql ( SQL Server )
- GUID
- GUID (COMBs?)
1 linq2sql ( linq2 [stuff]) 3. , , , , .
.