[twitter-dev] Re: Snowflake: An update and some very important information

2010-12-03 Thread TCI
Help. I had been using BINARY(16) to store tweet id's in MYSQL. I can't find a good resource to tell me the new data type I should use: Reading the mysql documentation, I believe it should be unsigned bigint - but would binary(64) be a better option? I also read this comment against about BIGINT,

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-12-03 Thread Tom van der Woerdt
Signed bigint is what Snowflake itself uses. Tom On 12/3/10 7:26 PM, TCI wrote: Help. I had been using BINARY(16) to store tweet id's in MYSQL. I can't find a good resource to tell me the new data type I should use: Reading the mysql documentation, I believe it should be unsigned bigint - but

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-23 Thread DustyReagan
Maybe this is a little naive, and I know you gotta' consider backwards compatibility, but it seems like a bad idea to rely on status ID for chronological sorting. If you want tweets displayed in order, sort by the timestamp. If you get rid of the sorting requirement on the ID. Why not do what Dean

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-22 Thread jough
I gather the reason for the 64-bit int type was to maintain some backwards-compatibility around the old sequential IDs, so both the old- style and Snowflake IDs could be sorted and you could glean that smaller IDs are older than larger integers. U/GUIDs wouldn't be sortable in any meaningful

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-20 Thread dean
Why not just use a GUID or UUID type for the ID type (IE: 3F2504E0-4F89-11D3-9A0C-0305E82C3301)? This way you're not restricted by using a numeric data type that each language could potentially define differently. For languages that don't directly have a GUID or UUID type, they can treat that ID

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-19 Thread mattpaul
+1 for bumping the version number and maintaining backwards compatibility. On Oct 20, 2:23 pm, Josh Roesslein jroessl...@gmail.com wrote: Isn't the point of having versioned API's so changes can be rolled out w/o breaking a much of applications at once? Why not increment to version 2 and

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-11 Thread SM
Thanks, Tom. I also hope the answer to my first question is No. I asked the 2nd question because in Matt's message that started this thread, he says: * If your code converts the ID successfully without losing accuracy you are OK but should consider converting to the _str versions of IDs as soon

[twitter-dev] Re: Snowflake: An update and some very important information

2010-11-10 Thread SM
Hello. Couple questions: 1.) Are you planning on eventually eliminating the integer representation and only using strings for id's? 2.) If an application doesn't use Javascript to parse JSON (for example, YAJL-OBJC and NSNumbers in Obj-C), is it necessary to make any changes at all? Thanks.

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-11-10 Thread Tom van der Woerdt
1) Please don't, I don't want to have to convert everything back to integers within my code. I consider the string representation a hack around some issues with certain programming languages, and not an optimal solution. Wouldn't want this to become the default option. 2) No Tom On 11/11/10

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-25 Thread Johannes la Poutre
@Themattharris: was there any change to the implementation timeline? Quote: by 22nd October 2010 (Friday): String versions of ID numbers will start appearing in the API responses I'm still not seeing id_str, to_user_id_str and from_user_id_str etc. in the current search API output, example:

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-25 Thread Tim
What about methods that list IDs without keys? e.g. blocks/ids which produces a array like [ 12345, 6789, ] These appear to be still cast as integers. I don't see the point in having integer IDs at all. Surely the case of people wishing to handle them as integers is far smaller than the case

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-25 Thread Slate Smith
It's there. But for some reason now in all types of json requests - On Oct 25, 2010, at 6:28 AM, Johannes la Poutre wrote: @Themattharris: was there any change to the implementation timeline? Quote: by 22nd October 2010 (Friday): String versions of ID numbers will start appearing in the API

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-25 Thread Matt Harris
The Search API hasn't rolled those fields in yet but they are due soon. The API does include these fields but as Tim has highlighted the xyz/ids methods don't yet have a String version. The engineering teams are aware of this and are working on it. I'll post an update once those additional

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-25 Thread Matt Harris
Hey everyone, Further to this mornings email, the Search API now contains the _str representations of it's IDs. Best @themattharris Developer Advocate, Twitter http://twitter.com/themattharris On Mon, Oct 25, 2010 at 1:33 PM, Matt Harris thematthar...@twitter.comwrote: The Search API hasn't

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-22 Thread Reivax
What's the point? That would still require a change in the JSON output, to replace integers with strings. On 21 oct, 15:38, David Nicol davidni...@gmail.com wrote: Unless I did the math wrong, a 64 bit quantity is expressable in (64 * log(2)) / log(62) = 10.7487219 eleven characters drawn

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-21 Thread David Nicol
Unless I did the math wrong, a 64 bit quantity is expressable in (64 * log(2)) / log(62) = 10.7487219 eleven characters drawn from A-Za-z0-9 and they can still be sortable! -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter:

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-20 Thread M. Edward (Ed) Borasky
6) Why not restrict IDs to 53bits? A Snowflake ID is composed: * 41bits for millisecond precision time (69 years) * 10bits for a configured machine identity (1024 machines) * 12bits for a sequence number (4096 per machine) The factor influencing the length of the ID is the time. For a 53bit

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-20 Thread Navin Kabra
On Oct 19, 5:19 am, Matt Harris thematthar...@twitter.com wrote: So what is Snowflake? -- Snowflake is a service we will be using to generate unique Tweet IDs. These Tweet IDs are unique 64bit unsigned integers, which, instead of being sequential like the current

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-20 Thread Tom van der Woerdt
Yes, you can. Tom On Oct 20, 2010, at 1:37 PM, Navin Kabra navin.ka...@gmail.com wrote: On Oct 19, 5:19 am, Matt Harris thematthar...@twitter.com wrote: So what is Snowflake? -- Snowflake is a service we will be using to generate unique Tweet IDs. These Tweet

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-20 Thread CodeWarden
Matt, In your example you show an unsigned long that uses the full 64 bits bits, which fails to be properly represented on a Java platform. In a later explanation you say that there will only ever be 63 bits used. Can you confirm one way or the other? i.e. will we ever see an unsigned

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-20 Thread Josh Roesslein
Isn't the point of having versioned API's so changes can be rolled out w/o breaking a much of applications at once? Why not increment to version 2 and replace all ID's as strings in the JSON format? Keep version 1 around for a few months allowing everyone to upgrade and then kill it off. This can

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread jon
Hi, Will user ids be generated by snowflake in the near future? Is it safe to parse and store them as signed 64bit integers? Thanks. On Oct 18, 8:34 pm, themattharris thematthar...@twitter.com wrote: Thanks to @gotwalt for spotting the missing commas. Fixed JSON sample ... [   {    

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread jon
Hi, You wrote that the IDs are unsigned 64 bit ints, but the IdWorker is pumping out java Longs which are signed. I'm assuming that was a typo, but please clarify. http://github.com/twitter/snowflake/blob/master/src/main/scala/com/twitter/service/snowflake/IdWorker.scala Thanks, - Jon On Oct

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Detroitpro
Out of curiosity; what advantage is there of including both the int and the string? Why not only offer the string and put the parsing on the client side? Thanks, @detroitpro On Oct 18, 8:34 pm, themattharris thematthar...@twitter.com wrote: Thanks to @gotwalt for spotting the missing commas.

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Reivax
Hi In the case where an id is null (as in in_reply_to_status_id:null ) what will the value of in_reply_to_status_id_str be ? Thanks Xavier On 19 oct, 02:34, themattharris thematthar...@twitter.com wrote: Thanks to @gotwalt for spotting the missing commas. Fixed JSON sample ... [   {    

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Tom van der Woerdt
Because a lot of Twitter applications (including my own) would go crazy immediately. Tom On 10/19/10 6:09 AM, Detroitpro wrote: Out of curiosity; what advantage is there of including both the int and the string? Why not only offer the string and put the parsing on the client side? Thanks,

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Tom van der Woerdt
Probably null as well. Tom On 10/19/10 11:49 AM, Reivax wrote: Hi In the case where an id is null (as in in_reply_to_status_id:null ) what will the value of in_reply_to_status_id_str be ? Thanks Xavier On 19 oct, 02:34, themattharris thematthar...@twitter.com wrote: Thanks to

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Dan Checkoway
I'm also patiently awaiting a response from twitter about this. Are the ids sane for 64-bit *signed* long? Dan On Mon, Oct 18, 2010 at 9:08 PM, jon jonhoff...@gmail.com wrote: Hi, You wrote that the IDs are unsigned 64 bit ints, but the IdWorker is pumping out java Longs which are signed.

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Craig Hockenberry
This approach feels wrong to me. The red flag is the duplication of data within the payload: in 30+ years of professional development, I've never seen that work out well. The root of the problem is that you've chosen to deliver data in a format (JSON) that can't support integers with a value

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Hayes Davis
I did some investigation into the snowflake algorithm recently and yes, it's safe for 64bit signed longs. Even if Twitter moved away from using scala/java longs internally (which are definitely signed), you'd still have something like 65 years from now before the algorithm rolled past the 2^63-1

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Tom van der Woerdt
I wouldn't blame this on JSON, because it's not JSON that has the problems, but JavaScript. All of my Objective-C apps that communicate use JSON as well, and they don't have the limitation. The issue does not apply to XML either - there's no type specification in XML. As far as I know, this issue

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread M. Edward (Ed) Borasky
With all due respect, the root of the problem is that computer scientists think in terms of abstract machines with infinitely-wide registers, infinitely many addressable RAM cells, etc., and business people think in terms of human populations and their tweet rates growing geometrically for

Re: [twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Tom van der Woerdt
You normally don't need all 53 bits - but as snowflake simply skips a few IDs every now and then, you get a lot more IDs. Chance of it actually reaching 53 bits? I'd say that it happens at the end of November... Friday the 26th? Tom On 10/19/10 8:04 PM, M. Edward (Ed) Borasky wrote: With all

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Craig Hockenberry
This still gives you some API legacy that you need to maintain, but it's a much cleaner approach than what is currently being proposed. -ch On Oct 19, 10:39 am, Tom van der Woerdt i...@tvdw.eu wrote: I wouldn't blame this on JSON, because it's not JSON that has the problems, but JavaScript.

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread twittelator
It's kind of cool that Craig has been programming professionally longer than some people on this list have even been alive! I've thought about the problem, and at least came up with a catchy name for it to go with the crises of yore: Bitpocalypse. Since Twittelator uses the JSON library YAJL,

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-19 Thread Matt Harris
Hey everyone, Thank you to all of you for your questions, patience and contributions to this thread. Hearing your views and knowing how you use the API helps us provide more information where there wasn't enough, and clarify details where there was ambiguity. I've collated the questions i've

[twitter-dev] Re: Snowflake: An update and some very important information

2010-10-18 Thread themattharris
Thanks to @gotwalt for spotting the missing commas. Fixed JSON sample ... [ { coordinates: null, truncated: false, created_at: Thu Oct 14 22:20:15 + 2010, favorited: false, entities: { urls: [ ], hashtags: [ ], user_mentions: [ {