Our system runs on multiple servers. All the tables in our system uses GUID
as the Primary Key
and Foreign Key
fields. This is however our old system and it it going through a brand new rewrite.
The motivation to use GUID
in the old system was for migration of data. It is perfectly reasonable to migrate items from one server to another. So using int
as ids will be problematic when data gets migrated across.
Now the new system we want to use GUID
as ids as well due to the migration factor. The new system will be written using DDD with MVC 4. Also we are using KendoUI for UI controls.
KendoUI by the looks of things does not support GUID
int its grids for Foreign Key
s. The column is blank when they are used.
Someone mentioned that my design is wrong and should not use GUID
as the id. Is it really wrong to use GUID
in the View Model
? It would be really difficult to use GUID
in the Domain Model
and int
in the View Model
.
What is the better datatype to use in a system where the Ids are important across multiple servers in case of migration.
Or is migration of data a separate issue where I should be using API's and domain services to migrate data over, in which case using int
as id is completely reasonable.
Can someone point me into the right direction please?
Aucun commentaire:
Enregistrer un commentaire