Prototyping Data Intensive Apps: TrendingTopics.org
Upcoming SlideShare
Loading in...5
×
 

Prototyping Data Intensive Apps: TrendingTopics.org

on

  • 37,939 views

Hadoop World 2009 talk on rapid prototyping of data intensive web applications with Hadoop, Hive, Amazon EC2, Python, and Ruby on Rails. Describes the process of building the open source trend ...

Hadoop World 2009 talk on rapid prototyping of data intensive web applications with Hadoop, Hive, Amazon EC2, Python, and Ruby on Rails. Describes the process of building the open source trend tracking site trendingtopics.org

Statistics

Views

Total Views
37,939
Views on SlideShare
5,003
Embed Views
32,936

Actions

Likes
19
Downloads
152
Comments
1

49 Embeds 32,936

http://www.datawrangling.com 25269
http://datawrangling.com 4687
http://www.seomoz.org 1826
http://feeds.feedburner.com 489
http://moz.com 346
http://localhost 85
http://translate.googleusercontent.com 48
http://127.0.0.1 28
http://www.slideshare.net 23
http://www.linkedin.com 19
http://www.netvibes.com 16
http://theoldreader.com 14
http://www.seowebhosting.net 13
https://www.linkedin.com 8
http://webcache.googleusercontent.com 6
https://www.newsblur.com 6
http://fig.ly 5
http://www.newsblur.com 4
http://static.slideshare.net 3
http://newsblur.com 3
http://www.jatinmahindra.com 3
http://onlinemarketingnews.org 3
http://datawrangling.com. 3
http://bazqux.com 2
http://www.fig.ly 2
http://internet-marketing.creativedaylight.com 2
http://www.worldlingo.com 1
http://74.6.117.48 1
http://simple-journey-38.heroku.com 1
http://static.slidesharecdn.com 1
http://ranksit.com 1
http://www.ranksit.com 1
http://hibu.comintelli.com 1
http://www.docseek.net 1
http://207.46.192.232 1
http://www.acomputerpro.org 1
http://magazin.bemoredifferent.com 1
http://linkdor.com 1
http://www.marketingavenue.com 1
http://hghltd.yandex.net 1
http://ppc.cc 1
http://honyaku.yahoofs.jp 1
http://www.google.com 1
http://dashboard.bloglines.com 1
http://www.acushare.com 1
https://www.datawrangling.com 1
http://translate.yandex.net 1
http://www.hanrss.com 1
http://nogiets.be 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • really cool~
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Prototyping Data Intensive Apps: TrendingTopics.org Prototyping Data Intensive Apps: TrendingTopics.org Presentation Transcript

  • Prototyping Data Intensive Apps: TrendingTopics.org Pete Skomoroch Research Scientist at LinkedIn Consultant at Data Wrangling @peteskomoroch 09/29/09 1
  • Talk Outline • TrendingTopics Overview • Wikipedia Page View Dataset • Hadoop on Amazon EC2 • Loading Data on EC2: Amazon EBS & S3 • Daily Timelines with Hadoop Streaming • Hive Data Warehouse Layer • Trend Computation with Hive • Hooking It All Together • Front End & Visualizations
  • Data Intensive Web Apps • Batch data mining or prediction with Hadoop • Iterate quickly with high level languages & tools – Pig, Hive, Clojure, Cascading, Python, Ruby • EC2: Get running with limited initial capital • Use external data and APIs in novel ways • Recent real world example: FlightCaster 3
  • TrendingTopics.org 4
  • Daily Pageview Timeline Charts 5
  • Detects Rising Trends with Hadoop 6
  • TrendingTopics is Open Source • Built as a side project at Data Wrangling • Core code completed over 2 weeks in June • Code on Github • Data released on Amazon Public Datasets 7
  • Technology Stack 8
  • Application Data Flow 9
  • Hadoop on Amazon EC2 • EC2: Launch servers on demand • S3: Simple Storage Service • EBS: Persistent disks for EC2 • Used Cloudera Hadoop Distribution – Includes Pig, Hive, HBase, Sqoop, EBS integration – Allows customization of Hadoop EC2 instances – See EC2 Docs and Tutorials on the Cloudera site 10
  • Wikipedia Page View Log Data • 1 TB of hourly log files from Wikipedia Squid proxy • Filename contains timestamp • Columns: project, pagename, pageviews, & bytes 11
  • Wikipedia Redirect Data • Many articles in the logs redirect to canonical titles • Amazon Public Dataset contains a lookup table: 12
  • Loading Data into Hadoop on EC2 • Hadoop can read directly from Amazon S3 • Pulling in data from EBS snapshots 13
  • Python Streaming for Daily Timelines 14
  • Streaming: Filter & Aggregate Logs 15
  • Hive Data Warehouse Layer on EC2 • Easy for analysts familar with SQL • Familar syntax (SELECT, GROUP BY, SORT...) • Hide the MR muck, for JOIN, UNION, etc. • Supports streaming UDFs • Sampling: generate datasets for R&D • Used on Timeline and Redirect data 16
  • Fixing Wiki Redirects with Hive JOIN 17
  • Trend Detection With Hadoop 18
  • Hourly Data: “Java” vs. “Hangover” 19
  • Robust Regression with R & Hadoop • Fit R model to hourly data for 2.3M Wiki articles • “Trending” if article views >> model prediction Page View “Spikes” 20
  • Call Python Trend Mapper from Hive 21
  • Simple Trend Calculation in Python 22
  • Use Trend Scores to Rank Articles 23
  • Exporting Data from our EC2 Cluster • Output files are delimited text for bulk DB load • Distcp outputs to S3: – hadoop distcp /user/output s3n://trendingtopics/exports • Hive can create tables directly over S3 filesystem: – create external table foo ... location 's3n://trendingtopics/ hiveoutput’ 24
  • Hooking It All Together 25
  • Ruby on Rails Front End • Run a development version of the app locally: 26
  • Automate & Deploy with EC2onRails • EC2onRails: Ubuntu server images for EC2, runs instances of Ruby on Rails, MySQL, Apache • Daily cron job on App server launches Hadoop • Hadoop EC2 boot script checks out latest trend detection code from Github • Capistrano tasks deploy new application code, maintain DB, cache, archives 27
  • Cron Triggers Hadoop Jobs on EC2 Modify Cloudera hadoop-ec2-init-remote.sh boot script 28
  • Bash Scripts Automate Daily Run • run_daily_merge.sh kicks off Hadoop/Hive jobs • Queries MySQL for last run date • Generates timelines with Hadoop streaming • Hive operates on timeline data, computes Trends with Python • Hive output copied to S3 • Calls remote script to load MySQL staging tables • Hadoop cluster self terminates • Remote script swaps staging and prod after load 29
  • Capistrano Tasks • Capistrano: Ruby tool for automating tasks on one or more remote servers (www.capify.org) • Deploys Rails code and cron jobs to App server • Cleanup tasks are triggered at end of load: – Flags featured Wikipedia articles – Indexes MySQL tables, Flushes cache 30
  • Visualization APIs • Google Viz API: Annotated Timeline for Rails • Google Charts sparklines: gc4r • Yahoo BOSS image search in Rails 31
  • Ideas & Next Steps • Try out the code on Github • Show related articles using link graph data • Extract trending phrases from article text • Boost Twitter trending topics with Wikipedia logs • Update top trends hourly • Use date partitioned tables, incremental updates • Add a real search engine (uses MySQL now) 32
  • LinkedIn Analytics Team We’re Hiring 33
  • Questions? • Contact – Blog: datawrangling.com – Twitter: @peteskomoroch • Code – http://github.com/datawrangling/trendingtopics – Hadoop blog posts & tutorials on the Cloudera site – Amazon EMR tutorial on Finding Similar Artists with Hadoop & Last.FM data http://bit.ly/EMRsimilarity 34