[twitter-dev] Re: Max tweet ID? Planning which datatype to use
Currently I am using bigint(12) On Dec 3, 2:06 am, Jay Liew wrote: > I believe I've just hit the upper bound limit on Django's > PositiveIntegerField for storing a single tweet's ID # > > What is the recommendation (if there is one), for application > developers in planning to store this field? > > Store it in a bigger integer data type .. or just maybe store the ID > as a var char? > > Thanks,
[twitter-dev] Re: Max tweet ID? Planning which datatype to use
Thanks guys, I think I will go for the Big Integer .. 2^64 (unsigned) should be plenty - unless tweet ID's can suddenly be negative (which 2^63 is still a lot). http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html Main reason that it's nice to be able to say "give me the largest tweet ID for this person", which would be cumbersome if it was stored as a string. I'll cross the bridge then 2^64 is not enough :/ Cheers, Jay On Dec 3, 2:06 pm, StarTrekRedneck wrote: > My general rule of thumb is to only use a numeric datatype (integer, > double, etc.) if the value is intended for mathematical operations > (like an account balance, or any amount or measurement). Some examples > of number-style data that I always store as strings/characters are > phone numbers and employeeidnumbers or any identification number. > The later would, of course, includetweetIDs. > > On Dec 3, 1:06 am, Jay Liew wrote: > > > > > I believe I've just hit the upper bound limit on Django's > > PositiveIntegerField for storing a singletweet'sID# > > > What is the recommendation (if there is one), for application > > developers in planning to store this field? > > > Store it in a bigger integer data type .. or just maybe store theID > > as a var char? > > > Thanks,
[twitter-dev] Re: Max tweet ID? Planning which datatype to use
My general rule of thumb is to only use a numeric datatype (integer, double, etc.) if the value is intended for mathematical operations (like an account balance, or any amount or measurement). Some examples of number-style data that I always store as strings/characters are phone numbers and employee id numbers or any identification number. The later would, of course, include tweet IDs. On Dec 3, 1:06 am, Jay Liew wrote: > I believe I've just hit the upper bound limit on Django's > PositiveIntegerField for storing a single tweet's ID # > > What is the recommendation (if there is one), for application > developers in planning to store this field? > > Store it in a bigger integer data type .. or just maybe store the ID > as a var char? > > Thanks,
[twitter-dev] Re: Max tweet ID? Planning which datatype to use
At Flaptor we use a CharField(max_length=20) which is big enough and seems reasonable since it is usually obtained from and used in urls. If you're interested in having a sorted index with the ids then you would have to look into bigger integer data types or add 0 padding behavior to your field. Regards, Santiago On Dec 3, 4:06 am, Jay Liew wrote: > I believe I've just hit the upper bound limit on Django's > PositiveIntegerField for storing a single tweet's ID # > > What is the recommendation (if there is one), for application > developers in planning to store this field? > > Store it in a bigger integer data type .. or just maybe store the ID > as a var char? > > Thanks,