Upscaling a Twitter streaming app - multiple streams for different users


#1

Hi,

Just looking for some advice after many an unfruitful read through the various bits of documentation available via Twitter.

Basically I want to set up a Twitter app so it can be used by multiple users. Ideally we want them to be able to sign in, authorise our app to use their twitter account (not sure what the correct terminology is for this), and then use their credentials to connect to the streaming API. Hopefully by connecting to the streaming API on the user’s behalf we can avoid the ‘no more than one simultaneous stream’ issue which we’ve seen when using the same API credentials on multiple development machines.

We only use the ‘track’ keywords functionality and we’re currently using the Twitter gem in a Rails/Sinatra environment.

Is there any guidance available on how to go about doing this? Will allowing the user to authenticate our app for use with their credentials allow us to connect to the streaming API on their behalf and run various simultaneous streams, one per user, without being disconnected with either ‘Duplicate stream’ or ‘Admin logout’ disconnect messages? Or will we still be limited to one simultaneous stream based on the server’s IP address?

Thanks.


Recommended architecture for cloud based twitter analysis service catering to multiple users
#2

Hi adam,

I am planning to do something very similar to what you mentioned. Did you test your approach? Any observations?

Thanks
JM


#3

I am not sure but your usecase sounds a lot like you want to apply for the Streaming API Site-Streams feature. It would help a bit if you elaborate further what exactly you are trying to do. The usual user streams are as far as I know only intended for the usecase where they are accessed from a client running on the users computer/mobile phone. If you need to scale to a large amount of users for server-side streams (i.e. for notifications) you should use sitestreams.