How Twitter Works (Arsen Kostenko Technology Stream)

IT Arena
IT ArenaIT Arena
HOW TWITTER WORKS
The Challenge
… and more!
How Twitter Works
Tweets
How Twitter Works
Just 140 characters???
How Twitter Works (Arsen Kostenko Technology Stream)
#oscars
#worldcup
How Twitter Works (Arsen Kostenko Technology Stream)
Twitter Architecture - How Twitter Works
Tweets
author
mention
actions
card
counts
Twitter Architecture - How Twitter Works
Let’s Draw Twitter’s Architecture!
clients routing API logic storage
Twitter Architecture - How Twitter Works
Twitter Architecture: The Old Days (~2010)
clients routing logic storage
MySQL
Cluster
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
API
The Monorail
(Ruby)
The Monorail
(Ruby)
The Monorail
(Ruby)
Twitter Architecture - How Twitter Works
Twitter Architecture: The Old Days (~2010)
Twitter Architecture - How Twitter Works
Twitter Architecture: Microservices
clients routing logic storage
Macaw-SwiftMacaw-Swift
User StoreGizmoduck
(User Service)
Web API
TFE
(Twitter Front End)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Tweet Store
Macaw-Tweets
Search Service
Direct Messages
Service
Macaw-Users
Macaw-Search
Macaw-DM
Graph Store
Tweet Graph
Store
Direct Messages
Store
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
Distributed
Key-Value Store
API
Macaw-SwiftMacaw-SwiftTweet API
Macaw-SwiftMacaw-SwiftUsers API
Macaw-SwiftMacaw-SwiftSearch API
Macaw-SwiftMacaw-SwiftMessages API
Macaw-SwiftMacaw-SwiftTweet Service
Tweetypie
(Tweet Service)
Macaw-SwiftMacaw-SwiftUser Service
Tweetypie
(Tweet Service)
Macaw-SwiftMacaw-SwiftTimeline Service
Tweetypie
(Tweet Service)
Macaw-SwiftMacaw-SwiftSocial Graph
Service
Tweetypie
(Tweet Service)
Macaw-SwiftMacaw-SwiftSearch Service
Tweetypie
(Tweet Service)
Macaw-SwiftMacaw-SwiftDirect Messages
Service
Macaw-Users
Macaw-SwiftMacaw-SwiftTimeline API
Twitter Architecture - How Twitter Works
Twitter Architecture: Microservices
10-100x performance
hundreds of million tweets/day
143,200 peak tweets/sec
How Twitter Works (Arsen Kostenko Technology Stream)
Twitter Architecture - How Twitter Works
Twitter Clients
clients routing logic storage
Manhattan
(Distributed DB)
Gizmoduck
(User Service)
Web API Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
TBird
(Tweet Store)
Tweets API
Search Service
Direct Messages
Service
Users API
Search API
Messages API
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
TFE
(Twitter Front End)
HTTPS
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
Manhattan
(Distributed DB)
API
Timeline API
Twitter Architecture - How Twitter Works
Twitter Front End (TFE)
clients routing logic storage
Manhattan
(Distributed DB)
Gizmoduck
(User Service)
TFE
(Twitter Front End)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
TBird
(Tweet Store)
Search Service
Direct Messages
Service
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
HTTPS HTTP
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
Manhattan
(Distributed DB)
API
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Presentation Layer Services
clients routing logic storage
Manhattan
(Distributed DB)
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
TBird
(Tweet Store)
Search Service
Direct Messages
Service
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
HTTP
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
HTTPS
Web API
Tweets API
Users API
Search API
Messages API
TFE
(Twitter Front End)
Thrift
Manhattan
(Distributed DB)
API
Timeline API
Twitter Architecture - How Twitter Works
Application Logic Services
clients routing logic storage
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
HTTP
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
HTTPS
TFE
(Twitter Front End)
Thrift
Web API
Tweets API
Users API
Search API
Messages API
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Manhattan
(Distributed DB)
API
Timeline API
Twitter Architecture - How Twitter Works
Storage Services
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter for
Android
twitter.com
Twitter API
Clients
HTTPS
TFE
(Twitter Front End)
Thrift
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
API
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Write Path Example: Tweet
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter for
Android
Twitter API
Clients
HTTPS
TFE
(Twitter Front End)
Thrift
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
twitter.com
API
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Write Path Example: Tweet
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter API
Clients
HTTPS Thrift
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
TFE
(Twitter Front End)
API
Twitter for
Android
twitter.com
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Write Path Example: Tweet
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter API
Clients
HTTPS Thrift
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
TFE
(Twitter Front End)
API
Twitter for
Android
twitter.com
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Write Path Example: Tweet
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter API
Clients
HTTPS Thrift
Direct Messages
Service
Manhattan
(Distributed DB)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
TFE
(Twitter Front End)
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
API
Twitter for
Android
twitter.com
TBird
(Tweet Store)
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Write Path Example: Tweet
clients routing logic storage
HTTP
TweetDeck
Twitter for iOS
Twitter API
Clients
HTTPS Thrift
Direct Messages
Service
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
TFE
(Twitter Front End)
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
API
Twitter for
Android
twitter.com
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Building a Timeline
Consider user timelines for three different Twitter users
Twitter Architecture - How Twitter Works
Building a Timeline
If you follow these three users...
time
Twitter Architecture - How Twitter Works
Building a Timeline
… we can build your Twitter
timeline as a list of tweets in
reverse chronological order:
time
Although we can also rely on
other pieces of information to
create tweet timelines that are
more relevant for our users.
Twitter Architecture - How Twitter Works
Building a Timeline
clients routing logic storage
TweetDeck
Twitter for iOS
Twitter for
Android
Twitter API
Clients
twitter.com TFE
(Twitter Front End)
Gizmoduck
(User Service)
Tweetypie
(Tweet Service)
Timeline Service
Social Graph
Service
Search Service
Direct Messages
Service
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Manhattan
(Distributed DB)
API
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Twitter Architecture - How Twitter Works
Building a Timeline
logic storage
Tweetypie
(Tweet Service)
Timeline
Servicec
Manhattan
(Distributed DB)
TBird
(Tweet Store)
Flock
(Graph Store)
TFlock
(Tweet Graph Store)
DMBird
(Direct Msg Store)
Haplo
(Redis cluster)
API
Web API
Tweets API
Users API
Search API
Messages API
Timeline API
Fanout
Service
TWITTER SERVICE STACK
How Twitter Works
Service Stack
Most services at Twitter run on the following stack:
Hardware
Twitter Service Stack - How Twitter Works
Distributed Resource Manager
Job Scheduler
Runtime
RPC Framework
Operating System
Network Server
REST Framework
Hardware
Mesos
Aurora
Scala + JVM
Finagle
Linux
TwitterServer
Finatra
Mesos and Aurora
Distributed resource manager
Twitter Service Stack - How Twitter Works
Hardware
OS
Hypervisor
OS
Hardware
OS
Mesos
Job
Job
Job
Job
Job
Job
OSJob
OSJob
OSJob
OSJob
Job scheduler
Scala, Finagle and Finatra
Twitter Service Stack - How Twitter Works
An object-oriented, functional
programming language
Compiles to Java bytecode
Used by most production
services at Twitter
An extensible RPC system for
high-concurrency clients and
servers
Supports HTTP, Thrift, and
other protocols
A framework for fast and
testable HTTP services
#oneteam
Mike Cvet @mikecvet
Moses Nakamura @mnnakamura
Saša Gargenta @sasa
Anna Sulkina @asulkina
Ricardo Cervera-Navarro @ricardoc
John Zeman @zeman
Julie Dilger @JulieDil
Nisha Antony @nantony345
Questions?
1 of 36

More Related Content

What's hot(20)

Unified JVM LoggingUnified JVM Logging
Unified JVM Logging
Yuji Kubota12.9K views
Jakarta EE 9 と これからJakarta EE 9 と これから
Jakarta EE 9 と これから
Kenji Kazumura612 views
GraphQL入門 (AWS AppSync)GraphQL入門 (AWS AppSync)
GraphQL入門 (AWS AppSync)
Amazon Web Services Japan18.3K views
ヤフー発のメッセージキュー「Pulsar」のご紹介ヤフー発のメッセージキュー「Pulsar」のご紹介
ヤフー発のメッセージキュー「Pulsar」のご紹介
Yahoo!デベロッパーネットワーク12.2K views
Javaのログ出力: 道具と考え方Javaのログ出力: 道具と考え方
Javaのログ出力: 道具と考え方
Taku Miyakawa74.2K views

Similar to How Twitter Works (Arsen Kostenko Technology Stream)

Howtwitter worksHowtwitter works
Howtwitter workszebikhan
296 views17 slides
TwetTwet
TwetRadu Sarghie
2K views15 slides

Similar to How Twitter Works (Arsen Kostenko Technology Stream) (20)

Twitter AwesomenessTwitter Awesomeness
Twitter Awesomeness
Damon Cortesi968 views
Howtwitter worksHowtwitter works
Howtwitter works
zebikhan296 views
Ti.developers.meetingTi.developers.meeting
Ti.developers.meeting
だいすけ ふるかわ1.7K views
TwetTwet
Twet
Radu Sarghie2K views
Silverlight+TwitterSilverlight+Twitter
Silverlight+Twitter
Krishnamoorthy Subramanian248 views
The Open Source... Behind the TweetsThe Open Source... Behind the Tweets
The Open Source... Behind the Tweets
Chris Aniszczyk2.9K views
Social Media DataSocial Media Data
Social Media Data
Will Simm299 views
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time Analytics
Amazon Web Services1K views
We are losing our tweets!We are losing our tweets!
We are losing our tweets!
John O'Brien III831 views
Services - Leo TotServices - Leo Tot
Services - Leo Tot
Software StartUp Academy Osijek276 views
Twitter API 2.0Twitter API 2.0
Twitter API 2.0
Alex Payne2.7K views
Twitter - What, Why, Who & HowTwitter - What, Why, Who & How
Twitter - What, Why, Who & How
point2five413 views
The Value of TwitterThe Value of Twitter
The Value of Twitter
Adam Blackwood943 views

More from IT Arena(20)

Recently uploaded(20)

[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh36 views
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptx
Hajira Mahmood21 views
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation24 views
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 Catalunya59 views
ThroughputThroughput
Throughput
Moisés Armani Ramírez31 views

How Twitter Works (Arsen Kostenko Technology Stream)

  • 2. … and more! How Twitter Works
  • 3. Tweets How Twitter Works Just 140 characters???
  • 8. Twitter Architecture - How Twitter Works Tweets author mention actions card counts
  • 9. Twitter Architecture - How Twitter Works Let’s Draw Twitter’s Architecture! clients routing API logic storage
  • 10. Twitter Architecture - How Twitter Works Twitter Architecture: The Old Days (~2010) clients routing logic storage MySQL Cluster TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients API The Monorail (Ruby) The Monorail (Ruby) The Monorail (Ruby)
  • 11. Twitter Architecture - How Twitter Works Twitter Architecture: The Old Days (~2010)
  • 12. Twitter Architecture - How Twitter Works Twitter Architecture: Microservices clients routing logic storage Macaw-SwiftMacaw-Swift User StoreGizmoduck (User Service) Web API TFE (Twitter Front End) Tweetypie (Tweet Service) Timeline Service Social Graph Service Tweet Store Macaw-Tweets Search Service Direct Messages Service Macaw-Users Macaw-Search Macaw-DM Graph Store Tweet Graph Store Direct Messages Store TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients Distributed Key-Value Store API Macaw-SwiftMacaw-SwiftTweet API Macaw-SwiftMacaw-SwiftUsers API Macaw-SwiftMacaw-SwiftSearch API Macaw-SwiftMacaw-SwiftMessages API Macaw-SwiftMacaw-SwiftTweet Service Tweetypie (Tweet Service) Macaw-SwiftMacaw-SwiftUser Service Tweetypie (Tweet Service) Macaw-SwiftMacaw-SwiftTimeline Service Tweetypie (Tweet Service) Macaw-SwiftMacaw-SwiftSocial Graph Service Tweetypie (Tweet Service) Macaw-SwiftMacaw-SwiftSearch Service Tweetypie (Tweet Service) Macaw-SwiftMacaw-SwiftDirect Messages Service Macaw-Users Macaw-SwiftMacaw-SwiftTimeline API
  • 13. Twitter Architecture - How Twitter Works Twitter Architecture: Microservices 10-100x performance hundreds of million tweets/day
  • 16. Twitter Architecture - How Twitter Works Twitter Clients clients routing logic storage Manhattan (Distributed DB) Gizmoduck (User Service) Web API Tweetypie (Tweet Service) Timeline Service Social Graph Service TBird (Tweet Store) Tweets API Search Service Direct Messages Service Users API Search API Messages API Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) TFE (Twitter Front End) HTTPS TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients Manhattan (Distributed DB) API Timeline API
  • 17. Twitter Architecture - How Twitter Works Twitter Front End (TFE) clients routing logic storage Manhattan (Distributed DB) Gizmoduck (User Service) TFE (Twitter Front End) Tweetypie (Tweet Service) Timeline Service Social Graph Service TBird (Tweet Store) Search Service Direct Messages Service Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) HTTPS HTTP TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients Manhattan (Distributed DB) API Web API Tweets API Users API Search API Messages API Timeline API
  • 18. Twitter Architecture - How Twitter Works Presentation Layer Services clients routing logic storage Manhattan (Distributed DB) Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service TBird (Tweet Store) Search Service Direct Messages Service Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) HTTP TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients HTTPS Web API Tweets API Users API Search API Messages API TFE (Twitter Front End) Thrift Manhattan (Distributed DB) API Timeline API
  • 19. Twitter Architecture - How Twitter Works Application Logic Services clients routing logic storage Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) HTTP TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients HTTPS TFE (Twitter Front End) Thrift Web API Tweets API Users API Search API Messages API Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Manhattan (Distributed DB) API Timeline API
  • 20. Twitter Architecture - How Twitter Works Storage Services clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter for Android twitter.com Twitter API Clients HTTPS TFE (Twitter Front End) Thrift Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) API Web API Tweets API Users API Search API Messages API Timeline API
  • 21. Twitter Architecture - How Twitter Works Write Path Example: Tweet clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter for Android Twitter API Clients HTTPS TFE (Twitter Front End) Thrift Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) twitter.com API Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Web API Tweets API Users API Search API Messages API Timeline API
  • 22. Twitter Architecture - How Twitter Works Write Path Example: Tweet clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter API Clients HTTPS Thrift Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) TFE (Twitter Front End) API Twitter for Android twitter.com Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Web API Tweets API Users API Search API Messages API Timeline API
  • 23. Twitter Architecture - How Twitter Works Write Path Example: Tweet clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter API Clients HTTPS Thrift Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) TFE (Twitter Front End) API Twitter for Android twitter.com Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Web API Tweets API Users API Search API Messages API Timeline API
  • 24. Twitter Architecture - How Twitter Works Write Path Example: Tweet clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter API Clients HTTPS Thrift Direct Messages Service Manhattan (Distributed DB) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) TFE (Twitter Front End) Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service API Twitter for Android twitter.com TBird (Tweet Store) Web API Tweets API Users API Search API Messages API Timeline API
  • 25. Twitter Architecture - How Twitter Works Write Path Example: Tweet clients routing logic storage HTTP TweetDeck Twitter for iOS Twitter API Clients HTTPS Thrift Direct Messages Service Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) TFE (Twitter Front End) Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service API Twitter for Android twitter.com Web API Tweets API Users API Search API Messages API Timeline API
  • 26. Twitter Architecture - How Twitter Works Building a Timeline Consider user timelines for three different Twitter users
  • 27. Twitter Architecture - How Twitter Works Building a Timeline If you follow these three users... time
  • 28. Twitter Architecture - How Twitter Works Building a Timeline … we can build your Twitter timeline as a list of tweets in reverse chronological order: time Although we can also rely on other pieces of information to create tweet timelines that are more relevant for our users.
  • 29. Twitter Architecture - How Twitter Works Building a Timeline clients routing logic storage TweetDeck Twitter for iOS Twitter for Android Twitter API Clients twitter.com TFE (Twitter Front End) Gizmoduck (User Service) Tweetypie (Tweet Service) Timeline Service Social Graph Service Search Service Direct Messages Service Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Manhattan (Distributed DB) API Web API Tweets API Users API Search API Messages API Timeline API
  • 30. Twitter Architecture - How Twitter Works Building a Timeline logic storage Tweetypie (Tweet Service) Timeline Servicec Manhattan (Distributed DB) TBird (Tweet Store) Flock (Graph Store) TFlock (Tweet Graph Store) DMBird (Direct Msg Store) Haplo (Redis cluster) API Web API Tweets API Users API Search API Messages API Timeline API Fanout Service
  • 31. TWITTER SERVICE STACK How Twitter Works
  • 32. Service Stack Most services at Twitter run on the following stack: Hardware Twitter Service Stack - How Twitter Works Distributed Resource Manager Job Scheduler Runtime RPC Framework Operating System Network Server REST Framework Hardware Mesos Aurora Scala + JVM Finagle Linux TwitterServer Finatra
  • 33. Mesos and Aurora Distributed resource manager Twitter Service Stack - How Twitter Works Hardware OS Hypervisor OS Hardware OS Mesos Job Job Job Job Job Job OSJob OSJob OSJob OSJob Job scheduler
  • 34. Scala, Finagle and Finatra Twitter Service Stack - How Twitter Works An object-oriented, functional programming language Compiles to Java bytecode Used by most production services at Twitter An extensible RPC system for high-concurrency clients and servers Supports HTTP, Thrift, and other protocols A framework for fast and testable HTTP services
  • 35. #oneteam Mike Cvet @mikecvet Moses Nakamura @mnnakamura Saša Gargenta @sasa Anna Sulkina @asulkina Ricardo Cervera-Navarro @ricardoc John Zeman @zeman Julie Dilger @JulieDil Nisha Antony @nantony345