Your SlideShare is downloading. ×
0
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Twitter Big Data
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Twitter Big Data

4,909

Published on

How to access & analyse Twitter big data. Full working example using Storm and RedStorm in Ruby & JRuby. Code on github https://github.com/colinsurprenant/tweitgeist and live demo …

How to access & analyse Twitter big data. Full working example using Storm and RedStorm in Ruby & JRuby. Code on github https://github.com/colinsurprenant/tweitgeist and live demo http://tweitgeist.needium.com/

Published in: Technology
0 Comments
17 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,909
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
221
Comments
0
Likes
17
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Twitter Big Data Colin Surprenant @colinsurprenant Lead ninja warning: this presentation contains a few rage faces
  • 2. Twitter - Spring 2012● 350 million tweets/day● 140 million active users● >1 million applications using API
  • 3. Daily Twitter @ Needium50 000 000 processed tweets 5 000 opportunities 500 messages sent 100GB data
  • 4. Needium Geo
  • 5. Anatomy of a tweetWhats in a tweet? timestamp user message avatarAnything else?
  • 6. How to get the tweets?● Streaming API Subscribe to realtime feeds moving forward● REST Search API Search request on past data (1 week)
  • 7. Streaming APIpublic statuses from all users● status/filter track/location/follow ○ 5000 follow user ids ○ 400 track keywords ○ 25 location boxes ○ rate limited● status/sample ○ 1% of all public statuses (message id mod 100) ○ two status/sample streams will result in same data
  • 8. Streaming APIper user streams● User Streams ○ all data required to update a users display ○ requires users OAuth token ○ statuses from followings, direct messages, mentions ○ cannot open large number of user streams from same host● Site Streams ○ multiplexing of multiple User Streams
  • 9. Streaming APIFirehoseneed more/full data? only through partners● gnip.com● datasift.com● filtering/tracking● partial to full FirehoseWhats the catch?
  • 10. Streaming APIFirehoseBase Twitter data license$0.10 per 1000 tweets~$1 million/monthapprox for full Firehose
  • 11. Streaming APIFirehosestartup?
  • 12. Search API● REST API (http request/response) ○ search query ○ geocode (lat, long, radius) ○ result type (mixed/recent/popular) ○ since id● max 100 rpp and 1500 results● rate limited (~1 request/sec)
  • 13. Twitter GeoNO simple way to grabALL tweets for a given region
  • 14. Twitter GeoStreaming API● status/filter + location (bounding box) ○ only tweets with explicit coordinates ○ < 10% of all tweets
  • 15. Twitter GeoStreaming API● Firehose ○ < 10% of all tweets contains explicit coordinates ○ must do reverse geocoding on user profile location ○ user profile location is free form
  • 16. Twitter GeoSearch API● geocode (lat, long, radius) ● tweets with explicit coordinates ● tweets reverse geocoded from user profile location ● location field: free form text (Montreal / Montreal,Qc / Mtl / Mourial) ● false positives ● REST API: not for frequent polling ● rate limited (1 req/sec/ip)
  • 17. Twitter GeoSolutions?Thats your job!But seriously?
  • 18. Twitter Geo● search API intelligent polling farm ○ adjust polling interval to minimize polling in relation to traffic● streaming API status/filter/follow reader farm? ○ find N relevant users from city, # stream readers = N / 5000 ○ must do reverse geocoding ○ user list dynamic update● TOS gray zone
  • 19. StormDistributed and fault-tolerant realtime computation https://github.com/nathanmarz/storm
  • 20. Storm The promise● Guaranteed data processing● Horizontal scalability● Fault-tolerance● No intermediate message brokers● Higher level abstraction than message passing● Just work
  • 21. RedStorm JRuby integration & DSL for Storm Simplicity of Ruby + power of Storm https://github.com/colinsurprenant/redstorm +
  • 22. StormTypical use cases Stream processing Continuous computation
  • 23. StormConcepts Streams Tuple Tuple Tuple Tuple Tuple Unbounded sequence of tuples
  • 24. StormConcepts Spouts Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Source of streams
  • 25. StormConcepts Bolts Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Processes input streams and produce new streams
  • 26. StormConcepts Topology Network of spouts and bolts
  • 27. Storm What Storm does● Distributes code● Robust process management● Monitors topologies and reassigns failed tasks● Provides reliability by tracking tuple trees● Routing and partitioning of stream
  • 28. TweitgeistLive top 10 trending hashtags on Twitter DEMO https://github.com/colinsurprenant/tweitgeist Live demo: http://tweitgeist.needium.com
  • 29. Tweitgeist TwitterStream ExtractMessage ExtractHashtag RollingCount Rank Merge Spout Bolt Bolt Bolt Bolt Bolt Twitter field hashtag field hashtag UI global shuffle shuffleRedis Redisqueue queue stream message hashtag rolling ranking merging reader extract extract counter Shuffle grouping: Tuples are randomly distributed across the bolts tasks Fields grouping: The stream is partitioned by the fields specified in the grouping Global grouping: The entire stream goes to a single one of the bolts tasks
  • 30. TweitgeistTopology definition

×