Twitter for CS10 @ Berkeley (Spring 2011)

R
Raffi KrikorianPlatform Team Member
UC Berkeley - CS10
Giv ing a talk at Ca l’s CS10 - The
Beauty and Joy     of Computing.
inst. eecs.berkeley.e   du/~cs10/sp11
16 Mar via Twitter for iPhone



  from UC Berkeley
  277 Cory Hall
  Berkeley, CA
   View Tweets at this place
Follow me!




 twitter.com/raffi
 or send a SMS to 40404
 follow raffi
To start... What’s a Tweet?
Twitter is


the nature of news.
“Rudimentary communication
among individuals in real time
allows many to move together as
one” - @biz
One Word
April 10, 2008
  4:33:23 PM
One Word
                 April 10, 2008
                   4:33:23 PM




 And it’s over
April 11, 2008
1:27:26 PM
Super bowl
                 February 2011




the Grammys
 February 2011
Tunisia
January 2011




               Egypt
               January 2011
http://twitter.com/#!/toptweets/status/12483108178
http://twitter.com/#!/Emergency_In_SF/status/29440739442
http://twitter.com/#!/i80chains/status/9726084734
http://twitter.com/#!/remedyoakland/status/29002198672
http://twitter.com/#!/AlbionsOven/status/10015063036
How does Twitter work?
Twitter is just three things:
Tweets,relationships between those three
And the users, anD Timelines
A Tweet is a simple thing




                            140 characters
What’s in a tweet?


  {
       “id” :   787167620,
       “text”   : “Free”,
       “date”   : “2008-04-1 1 13:27:26”
       “user”   : “jamesbuck”
  }*
                                           *not quite, but close!
Where do they go?

                    Following
                    Followed by
Tweets multiply
TWEETs MULTIPLY
HOME TIMELINE
                 [27886578700,
                  27856404785,
                  27727644786,
                 27679412331,
                 27594550593,
                 27583976236,
                 27580246968,
                 27576503025,
                 27545926564,
                 27545450496,
                27539864336...
Is that it? ... YES! ... sorta ...
things get more complicated at scale
And scaling “real-time” is hard
How many Tweets are there?
How many Tweets are there?   140M!



                             off the chart
140M tweets       1600 tweets
    per day   ≈   per second
Twitter for CS10 @ Berkeley (Spring 2011)
Twitter for CS10 @ Berkeley (Spring 2011)
Twitter for CS10 @ Berkeley (Spring 2011)
140M tweets       1B tweets
                  1600 tweets
    per day   ≈   per second
                      week
Twitter for CS10 @ Berkeley (Spring 2011)
Tweets multiply




                   8,080 people
                  need to see my
                           tweet
@ladygaga
mother mons†er
6.8 million followers

@justinbieber
Justin Bieber
5.7 million followers

@BarackObama
44th President of the United States
5.6 million followers

@raffi
me!
5.1 thousand followers
@ladygaga
mother mons†er
8.8 million followers

@raffi
me!
8.0 thousand followers




    differs by10
     scaling 10 63
106deliveries       6000 deliveries
  per minute    ≈   per millisecond
A System is only as strong as its
weakest link
80 MB/sec
≈   10 ms/seek
10 ms        100 seeks
per seek   ≈   per second
MySQL
         Can’t generate IDs fast enough
Centralized and a single point of failure




                                     snowflake
                                    Highly available and uncoordinated (10kqps)
                                    Compatible with the           ecosystem
                                    http://github.com/twitter/snowflake
How big are they?
                         ≈
      1 tweet text       =
                         ≈     140 characters
                               18 MB/min
                         ≈     200 bytes
                         ≈     26 GB/day

            Just tweet text!
Lots of deliveries
1

                   Digraph                           2
            Need to represent this

                                                         4
    1   2      3     4                    3
1




                             Matrix
2




                             Naïve implementation is not scalable
3
4
Photo used under Creative Commons from jurvetson




          Distributed graph database

flockdb   High rate of CRUD operations
          Complex set arithmetic queries
          http://github.com/twitter/flockdb
200M registered users




       2006    2008     2010   2011
Using the system


   10B API calls       110,000 calls
        per day    ≈   per second
REST API
         XML/JSON API over HTTP
Poll-based system / pseudo real-time




                               hosebird
                               Streaming API
                               Long poll HTTP
                               Near real-time delivery of Tweets
Latency

200ms

100ms

 0ms
Twitter for CS10 @ Berkeley (Spring 2011)
Where do we want to be?

          Today - 200M people generate ~1600 TPS

Tomorrow - we want to support half the world and all its devices

        (right now, there are 6B people and 5B phones)
Follow me at
Questions?   twitter.com/raffi
1 of 52

Recommended

Twitter by the Numbers (Columbia University) by
Twitter by the Numbers (Columbia University)Twitter by the Numbers (Columbia University)
Twitter by the Numbers (Columbia University)Raffi Krikorian
3.7K views37 slides
500Startups @ Twitter by
500Startups @ Twitter500Startups @ Twitter
500Startups @ TwitterRaffi Krikorian
1K views33 slides
Twitter by the Numbers by
Twitter by the NumbersTwitter by the Numbers
Twitter by the NumbersRaffi Krikorian
33.3K views26 slides
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010 by
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010Raffi Krikorian
2.4K views46 slides
Developing for @twitterapi #hack4health by
Developing for @twitterapi #hack4healthDeveloping for @twitterapi #hack4health
Developing for @twitterapi #hack4healthRaffi Krikorian
1.7K views43 slides
Intro to developing for @twitterapi (updated) by
Intro to developing for @twitterapi (updated)Intro to developing for @twitterapi (updated)
Intro to developing for @twitterapi (updated)Raffi Krikorian
2.6K views64 slides

More Related Content

Viewers also liked

Activitat Boig Per Tu by
Activitat Boig Per TuActivitat Boig Per Tu
Activitat Boig Per TuEducació
549 views3 slides
Graficos de barras circular tic by
Graficos de barras   circular  ticGraficos de barras   circular  tic
Graficos de barras circular ticCecilia Laura Torres Pariona
710 views6 slides
Red-LíderesTIC Encuentro2 Diagnostico by
Red-LíderesTIC Encuentro2 DiagnosticoRed-LíderesTIC Encuentro2 Diagnostico
Red-LíderesTIC Encuentro2 DiagnosticoRed de Investigación Educativa - ieRed
154 views14 slides
West Hollywood Residence Phase I by
West Hollywood Residence   Phase IWest Hollywood Residence   Phase I
West Hollywood Residence Phase Iguest4f02fc0
249 views41 slides
Camera history week one by
Camera history week oneCamera history week one
Camera history week onePaul8989
381 views21 slides
Community is an oft (mis)used word by
Community is an oft (mis)used wordCommunity is an oft (mis)used word
Community is an oft (mis)used wordsankarshan mukhopadhyay
739 views24 slides

Viewers also liked(13)

Activitat Boig Per Tu by Educació
Activitat Boig Per TuActivitat Boig Per Tu
Activitat Boig Per Tu
Educació 549 views
West Hollywood Residence Phase I by guest4f02fc0
West Hollywood Residence   Phase IWest Hollywood Residence   Phase I
West Hollywood Residence Phase I
guest4f02fc0249 views
Camera history week one by Paul8989
Camera history week oneCamera history week one
Camera history week one
Paul8989381 views
Twitter: Engineering for Real-Time (Stanford ACM 2011) by Raffi Krikorian
Twitter: Engineering for Real-Time (Stanford ACM 2011)Twitter: Engineering for Real-Time (Stanford ACM 2011)
Twitter: Engineering for Real-Time (Stanford ACM 2011)
Raffi Krikorian10.7K views
Securing Your Ecosystem (FOWA Las Vegas 2011) by Raffi Krikorian
Securing Your Ecosystem (FOWA Las Vegas 2011)Securing Your Ecosystem (FOWA Las Vegas 2011)
Securing Your Ecosystem (FOWA Las Vegas 2011)
Raffi Krikorian4.7K views

Similar to Twitter for CS10 @ Berkeley (Spring 2011)

Twitter Rules by
Twitter RulesTwitter Rules
Twitter RulesSugree Phatanapherom
892 views16 slides
Twitter Awesomeness by
Twitter AwesomenessTwitter Awesomeness
Twitter AwesomenessDamon Cortesi
968 views30 slides
LeWeb 2011 - Analysis by
LeWeb 2011 - AnalysisLeWeb 2011 - Analysis
LeWeb 2011 - AnalysisVisibli
512 views13 slides
From incubator to exit: A brief history of Reddit, the first YCombinator success by
From incubator to exit: A brief history of Reddit, the first YCombinator successFrom incubator to exit: A brief history of Reddit, the first YCombinator success
From incubator to exit: A brief history of Reddit, the first YCombinator successStartupfest
604 views47 slides
Evolution of The Twitter Stack by
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter StackChris Aniszczyk
39.4K views50 slides

Similar to Twitter for CS10 @ Berkeley (Spring 2011)(15)

LeWeb 2011 - Analysis by Visibli
LeWeb 2011 - AnalysisLeWeb 2011 - Analysis
LeWeb 2011 - Analysis
Visibli512 views
From incubator to exit: A brief history of Reddit, the first YCombinator success by Startupfest
From incubator to exit: A brief history of Reddit, the first YCombinator successFrom incubator to exit: A brief history of Reddit, the first YCombinator success
From incubator to exit: A brief history of Reddit, the first YCombinator success
Startupfest604 views
Evolution of The Twitter Stack by Chris Aniszczyk
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter Stack
Chris Aniszczyk39.4K views
Maintaining reliability in an unreliable world by Jeremy Edberg
Maintaining reliability in an unreliable worldMaintaining reliability in an unreliable world
Maintaining reliability in an unreliable world
Jeremy Edberg1.5K views
Joyent circa 2006 (Scale with Rails) by bcantrill
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)
bcantrill4.1K views
Simplereach: Counters at Scale: A Cautionary Tale by DataStax Academy
Simplereach: Counters at Scale: A Cautionary TaleSimplereach: Counters at Scale: A Cautionary Tale
Simplereach: Counters at Scale: A Cautionary Tale
DataStax Academy1.8K views
Counters At Scale - A Cautionary Tale by Eric Lubow
Counters At Scale - A Cautionary TaleCounters At Scale - A Cautionary Tale
Counters At Scale - A Cautionary Tale
Eric Lubow1.8K views
E Science As A Lens On The World Lazowska by guest43b4df3
E Science As A Lens On The World   LazowskaE Science As A Lens On The World   Lazowska
E Science As A Lens On The World Lazowska
guest43b4df3266 views
E Science As A Lens On The World Lazowska by WCET
E Science As A Lens On The World   LazowskaE Science As A Lens On The World   Lazowska
E Science As A Lens On The World Lazowska
WCET302 views

More from Raffi Krikorian

Real-time systems at Twitter (Velocity 2012) by
Real-time systems at Twitter (Velocity 2012)Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)Raffi Krikorian
10.6K views42 slides
Developing for @twitterapi (Techcrunch Disrupt Hackathon) by
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Raffi Krikorian
7.9K views28 slides
Users and Geo by
Users and GeoUsers and Geo
Users and GeoRaffi Krikorian
1.2K views64 slides
Twitter and the Real-Time Web by
Twitter and the Real-Time WebTwitter and the Real-Time Web
Twitter and the Real-Time WebRaffi Krikorian
1.4K views36 slides
How to use Geolocation in your webapp @ FOWA Dublin 2010 by
How to use Geolocation in your webapp @ FOWA Dublin 2010How to use Geolocation in your webapp @ FOWA Dublin 2010
How to use Geolocation in your webapp @ FOWA Dublin 2010Raffi Krikorian
1K views42 slides
Intro to developing for @twitterapi by
Intro to developing for @twitterapiIntro to developing for @twitterapi
Intro to developing for @twitterapiRaffi Krikorian
10.5K views99 slides

More from Raffi Krikorian(18)

Real-time systems at Twitter (Velocity 2012) by Raffi Krikorian
Real-time systems at Twitter (Velocity 2012)Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)
Raffi Krikorian10.6K views
Developing for @twitterapi (Techcrunch Disrupt Hackathon) by Raffi Krikorian
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Raffi Krikorian7.9K views
Twitter and the Real-Time Web by Raffi Krikorian
Twitter and the Real-Time WebTwitter and the Real-Time Web
Twitter and the Real-Time Web
Raffi Krikorian1.4K views
How to use Geolocation in your webapp @ FOWA Dublin 2010 by Raffi Krikorian
How to use Geolocation in your webapp @ FOWA Dublin 2010How to use Geolocation in your webapp @ FOWA Dublin 2010
How to use Geolocation in your webapp @ FOWA Dublin 2010
Raffi Krikorian1K views
Intro to developing for @twitterapi by Raffi Krikorian
Intro to developing for @twitterapiIntro to developing for @twitterapi
Intro to developing for @twitterapi
Raffi Krikorian10.5K views
"What's Happening" to "What's Happening Here" @ Chirp by Raffi Krikorian
"What's Happening" to "What's Happening Here" @ Chirp"What's Happening" to "What's Happening Here" @ Chirp
"What's Happening" to "What's Happening Here" @ Chirp
Raffi Krikorian1.4K views
Handling Real-time Geostreams by Raffi Krikorian
Handling Real-time GeostreamsHandling Real-time Geostreams
Handling Real-time Geostreams
Raffi Krikorian1.6K views
Adding the "Where" to the "When" by Raffi Krikorian
Adding the "Where" to the "When"Adding the "Where" to the "When"
Adding the "Where" to the "When"
Raffi Krikorian1.9K views
Scala + WattzOn, sitting in a tree.... by Raffi Krikorian
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....
Raffi Krikorian1.6K views
Broken Hearts: How Valentine's Day causes global warming by Raffi Krikorian
Broken Hearts: How Valentine's Day causes global warmingBroken Hearts: How Valentine's Day causes global warming
Broken Hearts: How Valentine's Day causes global warming
Raffi Krikorian2.1K views
WattzOn presentation @ Web 2.0 Summit by Raffi Krikorian
WattzOn presentation @ Web 2.0 SummitWattzOn presentation @ Web 2.0 Summit
WattzOn presentation @ Web 2.0 Summit
Raffi Krikorian2K views

Recently uploaded

Info Session November 2023.pdf by
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdfAleksandraKoprivica4
15 views15 slides
STPI OctaNE CoE Brochure.pdf by
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
14 views1 slide
PRODUCT LISTING.pptx by
PRODUCT LISTING.pptxPRODUCT LISTING.pptx
PRODUCT LISTING.pptxangelicacueva6
18 views1 slide
Mini-Track: Challenges to Network Automation Adoption by
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation AdoptionNetwork Automation Forum
17 views27 slides
MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
37 views8 slides
The Research Portal of Catalonia: Growing more (information) & more (services) by
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)CSUC - Consorci de Serveis Universitaris de Catalunya
115 views25 slides

Recently uploaded(20)

STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays24 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec15 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10345 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software317 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc72 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi139 views

Twitter for CS10 @ Berkeley (Spring 2011)