SlideShare a Scribd company logo
1 of 33
500Startups
Giving  a talk about ou   r APIs and our
sc ale to the visitin g 500Startups
class.
28 Mar via Twitter for iPhone



  from Twitter
  795 Folsom Street
  San Francisco, CA
   View Tweets at this place
>750K client applications +
Officially Owned and Operated
Twitter is just three things:
Tweets,relationships between those three
And the users, anD Timelines
What is the TwitterAPI?
REST API
- provides basic Twitter functionality
- Read / Write (Tweet, Follow, DM, etc.)

Search API
- real-time search index

Streaming API
- HTTP long poll connection
- Tweets in real-time
Using the system


   10B API calls       115,000 calls
        per day    ≈   per second
Three main objects

Status Objects - the Tweet (text, author, and metadata)
User objects - username, screen name, avatar
Timelines - orderings of Tweets
Quick note on timelines

user - a the tweets a given user has authored
home - the main timeline you would see in a client
Mentions - all the tweets that @mention a user
Causing change

Tweeting - a POST to status/update
Following - a POST to friendships/create
DM-ing - a POST to direct_messages/new
Authentication
OAuth 1.0a
- signature based requests
- user driven access to the API
- client differentiated access to the API

Applications don’t have passwords
- applications store tokens for their users
- users can change passwords, but tokens still work

OAuth 2.0
- coming soon!
Limits
350 OAuth calls / user / hour / IP
- authenticated calls goes against calling user
- unauthenticated calls goes against calling IP

“Natural” limits
- limits on number of Tweets / DMs sent
- limits on number of follows / unfollows a day

Status Limits
- can’t send “duplicate” tweets
Streaming API
Persistent connections
- get pushed a tweet, in real-time, that matches your predicate
- “push” version of search
- read-only

User streams / Site streams
- re-create the client experience using streams
- great for “client” experiences
Latency

200ms

100ms

 0ms
Streaming API’s Track and follow
Track
- watch a particular keyword
- up to 200 can be sent

Follow
- get all the tweets (RTs, etc.) from a particular user
- up to 400 can be issued
Tools of the Trade
dev.twitter.com
- documentation central

twurl
- OAuth enabled version of curl
- allows you to manually test authenticated and unauthenticated REST

Twitter for Mac
- built in “developer console”
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
Tweets multiply




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

@justinbieber
Justin Bieber
8.3 million followers

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

@raffi
me!
8.5 thousand followers
@ladygaga
       mother mons†er
       8.9 million followers

       @raffi
       me!
       8.5 thousand followers



                     30,000 tweets
1 tweet from
               ≈ 10
         scaling for delivered
1000x more followers
  @ladygaga
                       6than me

                     per second
A System is only as strong as its
weakest link
200M registered users




       2006    2008     2010   2011
Lots of deliveries
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
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
Follow me at
Questions?   twitter.com/raffi

More Related Content

Similar to 500Startups @ Twitter

[System design] Design a tweeter-like system
[System design] Design a tweeter-like system[System design] Design a tweeter-like system
[System design] Design a tweeter-like systemAree Oh
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter StackChris Aniszczyk
 
Social Media Data
Social Media DataSocial Media Data
Social Media DataWill Simm
 
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010Raffi Krikorian
 
Stringcast Open
Stringcast OpenStringcast Open
Stringcast Openahamidi27
 
Hotspot: Openness and API's
Hotspot: Openness and API'sHotspot: Openness and API's
Hotspot: Openness and API'sMartijn Pannevis
 
Scaling Microblogging Services with Divergent Traffic Demands
Scaling Microblogging Services with Divergent Traffic DemandsScaling Microblogging Services with Divergent Traffic Demands
Scaling Microblogging Services with Divergent Traffic Demandsyeung2000
 
Real-Time Web Apps & .NET - What are your options?
Real-Time Web Apps & .NET - What are your options?Real-Time Web Apps & .NET - What are your options?
Real-Time Web Apps & .NET - What are your options?Phil Leggetter
 
Seattle bot + Twitter data prezo
Seattle bot + Twitter data prezoSeattle bot + Twitter data prezo
Seattle bot + Twitter data prezoHarrison Neff
 
Twitter API, Streaming and SharePoint 2013
Twitter API, Streaming and SharePoint 2013Twitter API, Streaming and SharePoint 2013
Twitter API, Streaming and SharePoint 2013Sebastian Huppmann
 
Semantic Web Science
Semantic Web ScienceSemantic Web Science
Semantic Web ScienceJames Hendler
 
Facebook, Robert Johnson
Facebook, Robert JohnsonFacebook, Robert Johnson
Facebook, Robert JohnsonFuenteovejuna
 
Twarfing: Malicious Tweets
Twarfing: Malicious TweetsTwarfing: Malicious Tweets
Twarfing: Malicious TweetsCostin Raiu
 
Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Eli White
 
Solbase & Real-time Activity
Solbase & Real-time ActivitySolbase & Real-time Activity
Solbase & Real-time ActivityRon White
 

Similar to 500Startups @ Twitter (20)

Twitter Awesomeness
Twitter AwesomenessTwitter Awesomeness
Twitter Awesomeness
 
[System design] Design a tweeter-like system
[System design] Design a tweeter-like system[System design] Design a tweeter-like system
[System design] Design a tweeter-like system
 
Twitter System Design
Twitter System DesignTwitter System Design
Twitter System Design
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter Stack
 
Social Media Data
Social Media DataSocial Media Data
Social Media Data
 
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
Twitter - Guest Lecture UC Berkeley CS10 Fall 2010
 
Stringcast Open
Stringcast OpenStringcast Open
Stringcast Open
 
Hotspot: Openness and API's
Hotspot: Openness and API'sHotspot: Openness and API's
Hotspot: Openness and API's
 
Scaling Microblogging Services with Divergent Traffic Demands
Scaling Microblogging Services with Divergent Traffic DemandsScaling Microblogging Services with Divergent Traffic Demands
Scaling Microblogging Services with Divergent Traffic Demands
 
Real-Time Web Apps & .NET - What are your options?
Real-Time Web Apps & .NET - What are your options?Real-Time Web Apps & .NET - What are your options?
Real-Time Web Apps & .NET - What are your options?
 
Twitter by the Numbers
Twitter by the NumbersTwitter by the Numbers
Twitter by the Numbers
 
Seattle bot + Twitter data prezo
Seattle bot + Twitter data prezoSeattle bot + Twitter data prezo
Seattle bot + Twitter data prezo
 
Twitter API, Streaming and SharePoint 2013
Twitter API, Streaming and SharePoint 2013Twitter API, Streaming and SharePoint 2013
Twitter API, Streaming and SharePoint 2013
 
Semantic Web Science
Semantic Web ScienceSemantic Web Science
Semantic Web Science
 
Facebook, Robert Johnson
Facebook, Robert JohnsonFacebook, Robert Johnson
Facebook, Robert Johnson
 
Cdo
CdoCdo
Cdo
 
We are losing our tweets!
We are losing our tweets!We are losing our tweets!
We are losing our tweets!
 
Twarfing: Malicious Tweets
Twarfing: Malicious TweetsTwarfing: Malicious Tweets
Twarfing: Malicious Tweets
 
Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011
 
Solbase & Real-time Activity
Solbase & Real-time ActivitySolbase & Real-time Activity
Solbase & Real-time Activity
 

More from Raffi Krikorian

Re-architecting on the Fly #OReillySACon
Re-architecting on the Fly #OReillySACon Re-architecting on the Fly #OReillySACon
Re-architecting on the Fly #OReillySACon Raffi Krikorian
 
Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)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)
Twitter: Engineering for Real-Time (Stanford ACM 2011)Raffi Krikorian
 
Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Raffi Krikorian
 
Twitter by the Numbers (Columbia University)
Twitter by the Numbers (Columbia University)Twitter by the Numbers (Columbia University)
Twitter by the Numbers (Columbia University)Raffi Krikorian
 
Twitter and the Real-Time Web
Twitter and the Real-Time WebTwitter and the Real-Time Web
Twitter and the Real-Time WebRaffi Krikorian
 
Intro to developing for @twitterapi (updated)
Intro to developing for @twitterapi (updated)Intro to developing for @twitterapi (updated)
Intro to developing for @twitterapi (updated)Raffi Krikorian
 
How to use Geolocation in your webapp @ FOWA Dublin 2010
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
 
Intro to developing for @twitterapi
Intro to developing for @twitterapiIntro to developing for @twitterapi
Intro to developing for @twitterapiRaffi 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
"What's Happening" to "What's Happening Here" @ ChirpRaffi Krikorian
 
Handling Real-time Geostreams
Handling Real-time GeostreamsHandling Real-time Geostreams
Handling Real-time GeostreamsRaffi Krikorian
 
Adding the "Where" to the "When"
Adding the "Where" to the "When"Adding the "Where" to the "When"
Adding the "Where" to the "When"Raffi Krikorian
 
Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Raffi Krikorian
 

More from Raffi Krikorian (20)

Hacking Conway's Law
Hacking Conway's LawHacking Conway's Law
Hacking Conway's Law
 
Re-architecting on the Fly #OReillySACon
Re-architecting on the Fly #OReillySACon Re-architecting on the Fly #OReillySACon
Re-architecting on the Fly #OReillySACon
 
Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)Real-time systems at Twitter (Velocity 2012)
Real-time systems at Twitter (Velocity 2012)
 
Twitter: Engineering for Real-Time (Stanford ACM 2011)
Twitter: Engineering for Real-Time (Stanford ACM 2011)Twitter: Engineering for Real-Time (Stanford ACM 2011)
Twitter: Engineering for Real-Time (Stanford ACM 2011)
 
Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)Developing for @twitterapi (Techcrunch Disrupt Hackathon)
Developing for @twitterapi (Techcrunch Disrupt Hackathon)
 
#rtgeo (Where 2.0 2011)
#rtgeo (Where 2.0 2011)#rtgeo (Where 2.0 2011)
#rtgeo (Where 2.0 2011)
 
Twitter by the Numbers (Columbia University)
Twitter by the Numbers (Columbia University)Twitter by the Numbers (Columbia University)
Twitter by the Numbers (Columbia University)
 
Users and Geo
Users and GeoUsers and Geo
Users and Geo
 
Twitter and the Real-Time Web
Twitter and the Real-Time WebTwitter and the Real-Time Web
Twitter and the Real-Time Web
 
Intro to developing for @twitterapi (updated)
Intro to developing for @twitterapi (updated)Intro to developing for @twitterapi (updated)
Intro to developing for @twitterapi (updated)
 
How to use Geolocation in your webapp @ FOWA Dublin 2010
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
 
Intro to developing for @twitterapi
Intro to developing for @twitterapiIntro to developing for @twitterapi
Intro to developing for @twitterapi
 
Twitter API Annotations
Twitter API AnnotationsTwitter API Annotations
Twitter API Annotations
 
"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
"What's Happening" to "What's Happening Here" @ Chirp
 
Energy / Tweet
Energy / TweetEnergy / Tweet
Energy / Tweet
 
Handling Real-time Geostreams
Handling Real-time GeostreamsHandling Real-time Geostreams
Handling Real-time Geostreams
 
Adding the "Where" to the "When"
Adding the "Where" to the "When"Adding the "Where" to the "When"
Adding the "Where" to the "When"
 
What's happening here?
What's happening here?What's happening here?
What's happening here?
 
WattzOn @ ETech 2009
WattzOn @ ETech 2009WattzOn @ ETech 2009
WattzOn @ ETech 2009
 
Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....Scala + WattzOn, sitting in a tree....
Scala + WattzOn, sitting in a tree....
 

Recently uploaded

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

500Startups @ Twitter

  • 2. Giving a talk about ou r APIs and our sc ale to the visitin g 500Startups class. 28 Mar via Twitter for iPhone from Twitter 795 Folsom Street San Francisco, CA View Tweets at this place
  • 3. >750K client applications + Officially Owned and Operated
  • 4. Twitter is just three things: Tweets,relationships between those three And the users, anD Timelines
  • 5. What is the TwitterAPI? REST API - provides basic Twitter functionality - Read / Write (Tweet, Follow, DM, etc.) Search API - real-time search index Streaming API - HTTP long poll connection - Tweets in real-time
  • 6. Using the system 10B API calls 115,000 calls per day ≈ per second
  • 7. Three main objects Status Objects - the Tweet (text, author, and metadata) User objects - username, screen name, avatar Timelines - orderings of Tweets
  • 8. Quick note on timelines user - a the tweets a given user has authored home - the main timeline you would see in a client Mentions - all the tweets that @mention a user
  • 9. Causing change Tweeting - a POST to status/update Following - a POST to friendships/create DM-ing - a POST to direct_messages/new
  • 10. Authentication OAuth 1.0a - signature based requests - user driven access to the API - client differentiated access to the API Applications don’t have passwords - applications store tokens for their users - users can change passwords, but tokens still work OAuth 2.0 - coming soon!
  • 11. Limits 350 OAuth calls / user / hour / IP - authenticated calls goes against calling user - unauthenticated calls goes against calling IP “Natural” limits - limits on number of Tweets / DMs sent - limits on number of follows / unfollows a day Status Limits - can’t send “duplicate” tweets
  • 12. Streaming API Persistent connections - get pushed a tweet, in real-time, that matches your predicate - “push” version of search - read-only User streams / Site streams - re-create the client experience using streams - great for “client” experiences
  • 14. Streaming API’s Track and follow Track - watch a particular keyword - up to 200 can be sent Follow - get all the tweets (RTs, etc.) from a particular user - up to 400 can be issued
  • 15. Tools of the Trade dev.twitter.com - documentation central twurl - OAuth enabled version of curl - allows you to manually test authenticated and unauthenticated REST Twitter for Mac - built in “developer console”
  • 16. Is that it? ... YES! ... sorta ...
  • 17. things get more complicated at scale And scaling “real-time” is hard
  • 18. How many Tweets are there?
  • 19. How many Tweets are there? 140M! off the chart
  • 20. 140M tweets 1600 tweets per day ≈ per second
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. Tweets multiply 8,080 people need to see my tweet
  • 26. @ladygaga mother mons†er 8.9 million followers @justinbieber Justin Bieber 8.3 million followers @BarackObama 44th President of the United States 7.1 million followers @raffi me! 8.5 thousand followers
  • 27. @ladygaga mother mons†er 8.9 million followers @raffi me! 8.5 thousand followers 30,000 tweets 1 tweet from ≈ 10 scaling for delivered 1000x more followers @ladygaga 6than me per second
  • 28. A System is only as strong as its weakest link
  • 29. 200M registered users 2006 2008 2010 2011
  • 31. 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
  • 32. 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
  • 33. Follow me at Questions? twitter.com/raffi