Is Guid the best identity datatype for Databases?

前端 未结 8 1874
眼角桃花
眼角桃花 2020-12-24 09:13

It is connected to BI and merging of data from different data sources and would make that process more smooth.

And is there an optimal migration strategy from a data

8条回答
  •  鱼传尺愫
    2020-12-24 09:52

    You will probably need the facility to track back to source for auditing purposes, especially on financial data.

    Even if you use synthetic keys in your warehouse system (which you almost certainly want to do if you have multiple data sources) you will still need to support auditing. Put a 'Data Source' and 'Natural Key' column on the tables in your system and populate them with a code for the source and a representation of whatever uniquely identifies the record at source.

    If you do this the synthetic keys need only be ints or numerics wide enough to store enough values (ints if <4b rows, numerics if over). This means they will be much more readable than a GUID.

提交回复
热议问题