When using a HiLo ID generation strategy, what types should be used to hold Ids?

Posted by UpTheCreek on Stack Overflow See other posts from Stack Overflow or by UpTheCreek
Published on 2010-05-10T08:15:35Z Indexed on 2010/05/11 6:44 UTC
Read the original article Hit count: 239

Filed under:
|
|

I'm asking this from a c#/NHibnernate perspective, but it's generally applicable. The concern is that the HiLo strategy goes though id's pretty quickly, and for example a low record-count table (Such as Users) is sharing from the same set of id's as a high record-count table (Such as comments). So you can potentially get to high numbers quicker that with other strategies. So what do people recommend?

Code side: int/uint/long/ulong?

DBSide: int/bigint?

My feeling is to go with longs and bigingts, but would like a sanity check :)

© Stack Overflow or respective owner

Related posts about hilo

Related posts about database-design