SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
#twitterflight
The Open Source… 
Behind the Tweets 
October 22, 2014 #twitterflight
Open source is everywhere! 
On your phone, in your car… and within Twitter! 
! 
http://www4.mercedes-benz.com/manual-cars/ba/foss/content/en/assets/FOSS_licences.pdf 
iOS: General->About->Legal->Legal Notices 
! 
Vine: General->About->Legal 
!
Chris Aniszczyk 
Head of Open Source 
@cra
Twitter runs on Open Source
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Tweet!
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin 
https://dev.twitter.com/rest/reference/post/statuses/update 
Your first stop as a tweet: Twitter Front End (TFE) 
A fancy reverse proxy for HTTP traffic built on the JVM 
Handles authentication, rate limits and more! 
Powered by the open source project Netty: http://netty.io
Netty at Twitter 
Netty is open source Java NIO framework 
Used heavily at Twitter 
Healthy adopter community: 
http://netty.io/wiki/adopters.html 
! 
Cloudhopper sends billions of SMS messages 
per month using Netty 
https://github.com/twitter/cloudhopper-smpp 
! 
We contributed SPDY support to Netty: 
http://netty.io/news/2012/02/04/3-3-1-spdy.html 
*https://blog.twitter.com/2013/netty-4-at-twitter-reduced-gc-overhead
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch 
fin 
Twitter backend architecture is *service-oriented (on the JVM) 
Core services are built on top of Finagle (using an API framework) 
Finagle is written in Scala and built on top of Netty 
https://github.com/twitter/finagle 
*http://www.slideshare.net/InfoQ/decomposing-twitter-adventures-in-serviceoriented-architecture
Finagle at Twitter 
Why Scala? 
Scala enables succinct expression (vs Java) 
Less typing is less reading; brevity enhances clarity 
Two open source Scala/Finagle guides from Twitter: 
https://twitter.github.io/effectivescala/ 
https://twitter.github.io/scala_school/ 
! 
Finagle is our fault tolerant protocol-agnostic 
RCP framework built on Netty 
Emphasizes services modularity via async futures 
Handles failover semantics, metrics, logging etc… 
*https://blog.twitter.com/2014/netty-at-twitter-with-finagle
Finagle Service Example 
// #1 Create a client for each service! 
val timelineSvc = Thrift.newIface[TimelineService](...)! 
val tweetSvc = Thrift.newIface[TweetService](...)! 
val authSvc = Thrift.newIface[AuthService](...)! 
! 
// #2 Create new Filter to authenticate incoming requests! 
val authFilter = Filter.mk[Req, AuthReq, Res, Res] { (req, svc) =>! 
authSvc.authenticate(req) flatMap svc(_)! 
}! 
! 
// #3 Create a service to convert an authenticated timeline request to a json response! 
val apiService = Service.mk[AuthReq, Res] { req =>! 
timelineSvc(req.userId) flatMap {tl =>! 
val tweets = tl map tweetSvc.getById(_)! 
Future.collect(tweets) map tweetsToJson(_) }! 
}! 
}! 
! 
// #4 Start a new HTTP server on port 80 using the authenticating filter and our service! 
Http.serve(":80", authFilter andThen apiService)!
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin 
Tweets need to be stored somewhere (via a Finagle-based core service) 
TBird: persistent storage for tweets 
Built originally on Gizzard: https://github.com/twitter/gizzard 
Tweets stored in sharded and replicated MySQL 
TFlock: track relations between users and tweets 
Built originally on FlockDB: https://github.com/twitter/flockdb
MySQL at Twitter 
Maintain a public fork of v5.5/v5.6 
Goal is to“work” with upstream 
https://github.com/twitter/mysql 
Co-founded the WebScaleSQL.org effort
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin 
When a tweet is generated it needs to be written to all relevant timelines 
Timelines are essentially a list of tweet ids (heavily cached) 
Fanout is the process where tweets are delivered to timelines 
For caching we rely on the open source project Redis 
https://github.com/antirez/redis
Redis at Twitter 
Redis is used for caching timelines and more! 
Added custom logging, data structures 
We are working to upstream some changes… 
@thinkingfish gave a fantastic talk on this: 
https://www.youtube.com/watch?v=rP9EKvWt0zo 
! 
Open Source Proxy for Redis: Twemproxy 
https://github.com/twitter/twemproxy 
Used by Vine, Pinterest, Wikimedia, Snapchat etc…
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
Everyone searches for tweets: https://dev.twitter.com/rest/public/search 
In fact, one of the most heavily trafficked search engines in the world 
Back in the day, Twitter search was built on MySQL 
Today, Twitter search is an optimized real-time search/indexing technology 
Powered by Apache Lucene: http://lucene.apache.org 
! 
! 
tweet write fanout search batch fin
Lucene (earlybird) at Twitter 
Earlybird* is Twitter’s real-time search engine 
built on top of Apache Lucene 
! 
We optimized Lucene (cut corners) to handle 
tweets only since that’s all we do 
e.g., less space: 140 characters only need 8 bits 
! 
Read about Blender, our search front-end 
https://blog.twitter.com/2011/twitter-search-now-3x-faster 
*http://www.umiacs.umd.edu/~jimmylin/publications/Busch_etal_ICDE2012.pdf
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch 
Hadoop is used for many things at Twitter, like counting words :) 
scribe logs, batch processing, recommendations, trends, user modeling and more! 
10,000+ hadoop servers, 100,000+ daily hadoop jobs,10M+ daily hadoop tasks 
Parquet is a columnar storage format for Hadoop 
https://parquet.incubator.apache.org 
Scalding is our Scala DSL for writing Hadoop jobs 
https://github.com/twitter/scalding 
! 
! 
fin
Parquet/Scalding at Twitter 
Parquet* is a columnar storage format 
Initially a collaboration between Twitter/Cloudera 
Inspired by Google Dremel paper** 
Now at Apache: http://parquet.incubator.apache.org/ 
! 
Scalding built on top of Scala and Cascading 
https://github.com/Cascading/cascading 
Makes it easier* to write Hadoop jobs (using Scala) 
*https://blog.twitter.com/2013/announcing-parquet-10-columnar-storage-for-hadoop
Scalding Example 
import com.twitter.scalding._! 
! 
// can’t have a Hadoop example without word count!! 
class WordCountJob(args : Args) extends Job(args) {! 
TextLine( args("input") )! 
.flatMap('line -> 'word) { line : String => line.split("""s+""") }! 
.groupBy('word) { _.size }! 
.write( Tsv( args("output") ) )! 
} 
https://github.com/twitter/scalding/wiki/Rosetta-Code
Life of a Tweet 
What open source technology do we use behind the scenes when we tweet? 
tweet write fanout search batch fin
Sharing is caring, contribute! 
Lets all make Twitter better! 
! 
! 
! 
opensource.twitter.com https://github.com/twitter
New Open Source API Samples 
Hack on the samples and improve them! 
https://github.com/twitterdev (t.co/code) 
! 
Also, later today check out 
the lightning talk by Andrew 
Noonan later about the 
“Twitter’s developer toolbox” 
!
Thank You
Q&A 
The Open Source Behind the Tweets 
http://opensource.twitter.com 
! 
Hope you learned something new! 
Come see us at the @TwitterOSS Booth! 
Chris Aniszczyk (@cra)
Resources 
https://opensource.twitter.com 
https://github.com/twitter/finagle 
https://github.com/twitter/zipkin 
https://github.com/twitter/scalding 
https://github.com/twitter/mysql 
https://github.com/twitter/twemproxy 
https://twitter.github.io/scala_school 
http://webscalesql.org 
http://mesos.apache.org 
http://parquet.incubator.apache.org 
!
Backup Slides 
October 22, 2014 #twitterflight
Where does it all run? 
Main concept: Datacenter as a computer 
Aggregation and not virtualization 
! 
! 
! 
mesos.apache.org 
framework 
offer 
hostname 
4 CPUs 
4 GB RAM 
offer 
hostname 
4 CPUs 
4 GB RAM 
offer 
hostname 
4 CPUs 
4 GB RAM 
offer 
hostname 
4 CPUs 
4 GB RAM 
masters aurora.incubator.apache.org
Profiles 
Search / S&R 
Trends / S&R 
Home timeline / TLS 
PTw / Ads 
Compose 
Contact import / 
Growth 
DMs / Social Discover / S&R 
WtF / S&R

Mais conteúdo relacionado

Mais procurados

Contributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestContributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestCheah Eng Soon
 
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013rivierarb
 
Open Source: Beyond the Code
Open Source: Beyond the CodeOpen Source: Beyond the Code
Open Source: Beyond the CodeKerri Shotts
 
Speedupiosdevelopment
SpeedupiosdevelopmentSpeedupiosdevelopment
Speedupiosdevelopmentslidepaddemo
 
LA Python #1: Intro, Events, Advocacy
LA Python #1: Intro, Events, AdvocacyLA Python #1: Intro, Events, Advocacy
LA Python #1: Intro, Events, AdvocacyAudrey Roy
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersDeepikaRana30
 
Hactoberfest presentation
Hactoberfest presentationHactoberfest presentation
Hactoberfest presentationAITIKDANDAPAT
 
BarCamb Connotea by Ian Mulvany
BarCamb Connotea by Ian MulvanyBarCamb Connotea by Ian Mulvany
BarCamb Connotea by Ian MulvanyIan Mulvany
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needsSteven Francia
 

Mais procurados (11)

Contributing to Open Source #Hacktoberfest
Contributing to Open Source #HacktoberfestContributing to Open Source #Hacktoberfest
Contributing to Open Source #Hacktoberfest
 
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
Ruby and Twitter at the Ruby drink-up of Sophia, January 2013
 
Open Source: Beyond the Code
Open Source: Beyond the CodeOpen Source: Beyond the Code
Open Source: Beyond the Code
 
Open Source and the Girl Geek (English)
Open Source and the Girl Geek (English)Open Source and the Girl Geek (English)
Open Source and the Girl Geek (English)
 
Speedupiosdevelopment
SpeedupiosdevelopmentSpeedupiosdevelopment
Speedupiosdevelopment
 
3112 final
3112 final3112 final
3112 final
 
LA Python #1: Intro, Events, Advocacy
LA Python #1: Intro, Events, AdvocacyLA Python #1: Intro, Events, Advocacy
LA Python #1: Intro, Events, Advocacy
 
Hacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginnersHacktoberfest 2020 - Open source for beginners
Hacktoberfest 2020 - Open source for beginners
 
Hactoberfest presentation
Hactoberfest presentationHactoberfest presentation
Hactoberfest presentation
 
BarCamb Connotea by Ian Mulvany
BarCamb Connotea by Ian MulvanyBarCamb Connotea by Ian Mulvany
BarCamb Connotea by Ian Mulvany
 
What every successful open source project needs
What every successful open source project needsWhat every successful open source project needs
What every successful open source project needs
 

Semelhante a The Open Source... Behind the Tweets

OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonCodeOps Technologies LLP
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentationTim Taplin
 
API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015Tom Johnson
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open StandardsAPIsecure_ Official
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptxKaviya452563
 
Social Media Data
Social Media DataSocial Media Data
Social Media DataWill Simm
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngineikailan
 
Mining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMatthew Russell
 
BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017Cisco DevNet
 
Mining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMatthew Russell
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016Cisco DevNet
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with TitaniumKevin Whinnery
 
Flutter - Fluent-Utter
Flutter - Fluent-UtterFlutter - Fluent-Utter
Flutter - Fluent-UtterApurva Gupta
 
Embedding Messages and Video Calls in your apps
Embedding Messages and Video Calls in your appsEmbedding Messages and Video Calls in your apps
Embedding Messages and Video Calls in your appsCisco DevNet
 
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...Codemotion
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017Amy Cheong
 

Semelhante a The Open Source... Behind the Tweets (20)

OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
We are losing our tweets!
We are losing our tweets!We are losing our tweets!
We are losing our tweets!
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentation
 
API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015
 
iOS勉強会
iOS勉強会iOS勉強会
iOS勉強会
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptx
 
Social Media Data
Social Media DataSocial Media Data
Social Media Data
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngine
 
Mining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started Guide
 
BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017
 
Web 2
Web 2Web 2
Web 2
 
Mining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started GuideMining the Social Web for Fun and Profit: A Getting Started Guide
Mining the Social Web for Fun and Profit: A Getting Started Guide
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with Titanium
 
Getting Started with Titanium
Getting Started with TitaniumGetting Started with Titanium
Getting Started with Titanium
 
Flutter - Fluent-Utter
Flutter - Fluent-UtterFlutter - Fluent-Utter
Flutter - Fluent-Utter
 
Embedding Messages and Video Calls in your apps
Embedding Messages and Video Calls in your appsEmbedding Messages and Video Calls in your apps
Embedding Messages and Video Calls in your apps
 
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...
Steve Sfartz - How to embed Messaging and Video in your apps - Codemotion Mil...
 
Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
 

Mais de Chris Aniszczyk

Bringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationBringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationChris Aniszczyk
 
Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Chris Aniszczyk
 
Open Container Initiative Update
Open Container Initiative UpdateOpen Container Initiative Update
Open Container Initiative UpdateChris Aniszczyk
 
Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Chris Aniszczyk
 
Rise of Open Source Programs
Rise of Open Source ProgramsRise of Open Source Programs
Rise of Open Source ProgramsChris Aniszczyk
 
The Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsThe Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsChris Aniszczyk
 
Open Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupOpen Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupChris Aniszczyk
 
Getting Students Involved in Open Source
Getting Students Involved in Open SourceGetting Students Involved in Open Source
Getting Students Involved in Open SourceChris Aniszczyk
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Chris Aniszczyk
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter StackChris Aniszczyk
 
Open Source Compliance at Twitter
Open Source Compliance at TwitterOpen Source Compliance at Twitter
Open Source Compliance at TwitterChris Aniszczyk
 
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Effective Development With Eclipse Mylyn, Git, Gerrit and HudsonEffective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Effective Development With Eclipse Mylyn, Git, Gerrit and HudsonChris Aniszczyk
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with EclipseChris Aniszczyk
 
Evolution of Version Control In Open Source
Evolution of Version Control In Open SourceEvolution of Version Control In Open Source
Evolution of Version Control In Open SourceChris Aniszczyk
 
ESE 2010: Using Git in Eclipse
ESE 2010: Using Git in EclipseESE 2010: Using Git in Eclipse
ESE 2010: Using Git in EclipseChris Aniszczyk
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at EclipseChris Aniszczyk
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Chris Aniszczyk
 
EclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiEclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiChris Aniszczyk
 
Open Source From The Trenches: How to Get Involved with Open Source and be Su...
Open Source From The Trenches: How to Get Involved with Open Source and be Su...Open Source From The Trenches: How to Get Involved with Open Source and be Su...
Open Source From The Trenches: How to Get Involved with Open Source and be Su...Chris Aniszczyk
 

Mais de Chris Aniszczyk (20)

Bringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationBringing an open source project to the Linux Foundation
Bringing an open source project to the Linux Foundation
 
Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)
 
Open Container Initiative Update
Open Container Initiative UpdateOpen Container Initiative Update
Open Container Initiative Update
 
Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)
 
Rise of Open Source Programs
Rise of Open Source ProgramsRise of Open Source Programs
Rise of Open Source Programs
 
The Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsThe Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 months
 
Open Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupOpen Source Lessons from the TODO Group
Open Source Lessons from the TODO Group
 
Getting Students Involved in Open Source
Getting Students Involved in Open SourceGetting Students Involved in Open Source
Getting Students Involved in Open Source
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter Stack
 
Open Source Compliance at Twitter
Open Source Compliance at TwitterOpen Source Compliance at Twitter
Open Source Compliance at Twitter
 
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Effective Development With Eclipse Mylyn, Git, Gerrit and HudsonEffective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with Eclipse
 
Evolution of Version Control In Open Source
Evolution of Version Control In Open SourceEvolution of Version Control In Open Source
Evolution of Version Control In Open Source
 
ESE 2010: Using Git in Eclipse
ESE 2010: Using Git in EclipseESE 2010: Using Git in Eclipse
ESE 2010: Using Git in Eclipse
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at Eclipse
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)
 
EclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiEclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGi
 
Open Source From The Trenches: How to Get Involved with Open Source and be Su...
Open Source From The Trenches: How to Get Involved with Open Source and be Su...Open Source From The Trenches: How to Get Involved with Open Source and be Su...
Open Source From The Trenches: How to Get Involved with Open Source and be Su...
 

Último

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Último (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

The Open Source... Behind the Tweets

  • 2. The Open Source… Behind the Tweets October 22, 2014 #twitterflight
  • 3. Open source is everywhere! On your phone, in your car… and within Twitter! ! http://www4.mercedes-benz.com/manual-cars/ba/foss/content/en/assets/FOSS_licences.pdf iOS: General->About->Legal->Legal Notices ! Vine: General->About->Legal !
  • 4. Chris Aniszczyk Head of Open Source @cra
  • 5. Twitter runs on Open Source
  • 6. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 8. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin https://dev.twitter.com/rest/reference/post/statuses/update Your first stop as a tweet: Twitter Front End (TFE) A fancy reverse proxy for HTTP traffic built on the JVM Handles authentication, rate limits and more! Powered by the open source project Netty: http://netty.io
  • 9. Netty at Twitter Netty is open source Java NIO framework Used heavily at Twitter Healthy adopter community: http://netty.io/wiki/adopters.html ! Cloudhopper sends billions of SMS messages per month using Netty https://github.com/twitter/cloudhopper-smpp ! We contributed SPDY support to Netty: http://netty.io/news/2012/02/04/3-3-1-spdy.html *https://blog.twitter.com/2013/netty-4-at-twitter-reduced-gc-overhead
  • 10. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin Twitter backend architecture is *service-oriented (on the JVM) Core services are built on top of Finagle (using an API framework) Finagle is written in Scala and built on top of Netty https://github.com/twitter/finagle *http://www.slideshare.net/InfoQ/decomposing-twitter-adventures-in-serviceoriented-architecture
  • 11. Finagle at Twitter Why Scala? Scala enables succinct expression (vs Java) Less typing is less reading; brevity enhances clarity Two open source Scala/Finagle guides from Twitter: https://twitter.github.io/effectivescala/ https://twitter.github.io/scala_school/ ! Finagle is our fault tolerant protocol-agnostic RCP framework built on Netty Emphasizes services modularity via async futures Handles failover semantics, metrics, logging etc… *https://blog.twitter.com/2014/netty-at-twitter-with-finagle
  • 12. Finagle Service Example // #1 Create a client for each service! val timelineSvc = Thrift.newIface[TimelineService](...)! val tweetSvc = Thrift.newIface[TweetService](...)! val authSvc = Thrift.newIface[AuthService](...)! ! // #2 Create new Filter to authenticate incoming requests! val authFilter = Filter.mk[Req, AuthReq, Res, Res] { (req, svc) =>! authSvc.authenticate(req) flatMap svc(_)! }! ! // #3 Create a service to convert an authenticated timeline request to a json response! val apiService = Service.mk[AuthReq, Res] { req =>! timelineSvc(req.userId) flatMap {tl =>! val tweets = tl map tweetSvc.getById(_)! Future.collect(tweets) map tweetsToJson(_) }! }! }! ! // #4 Start a new HTTP server on port 80 using the authenticating filter and our service! Http.serve(":80", authFilter andThen apiService)!
  • 13. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 14. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin Tweets need to be stored somewhere (via a Finagle-based core service) TBird: persistent storage for tweets Built originally on Gizzard: https://github.com/twitter/gizzard Tweets stored in sharded and replicated MySQL TFlock: track relations between users and tweets Built originally on FlockDB: https://github.com/twitter/flockdb
  • 15. MySQL at Twitter Maintain a public fork of v5.5/v5.6 Goal is to“work” with upstream https://github.com/twitter/mysql Co-founded the WebScaleSQL.org effort
  • 16. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 17. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin When a tweet is generated it needs to be written to all relevant timelines Timelines are essentially a list of tweet ids (heavily cached) Fanout is the process where tweets are delivered to timelines For caching we rely on the open source project Redis https://github.com/antirez/redis
  • 18. Redis at Twitter Redis is used for caching timelines and more! Added custom logging, data structures We are working to upstream some changes… @thinkingfish gave a fantastic talk on this: https://www.youtube.com/watch?v=rP9EKvWt0zo ! Open Source Proxy for Redis: Twemproxy https://github.com/twitter/twemproxy Used by Vine, Pinterest, Wikimedia, Snapchat etc…
  • 19. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 20. Life of a Tweet What open source technology do we use behind the scenes when we tweet? Everyone searches for tweets: https://dev.twitter.com/rest/public/search In fact, one of the most heavily trafficked search engines in the world Back in the day, Twitter search was built on MySQL Today, Twitter search is an optimized real-time search/indexing technology Powered by Apache Lucene: http://lucene.apache.org ! ! tweet write fanout search batch fin
  • 21. Lucene (earlybird) at Twitter Earlybird* is Twitter’s real-time search engine built on top of Apache Lucene ! We optimized Lucene (cut corners) to handle tweets only since that’s all we do e.g., less space: 140 characters only need 8 bits ! Read about Blender, our search front-end https://blog.twitter.com/2011/twitter-search-now-3x-faster *http://www.umiacs.umd.edu/~jimmylin/publications/Busch_etal_ICDE2012.pdf
  • 22. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 23. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch Hadoop is used for many things at Twitter, like counting words :) scribe logs, batch processing, recommendations, trends, user modeling and more! 10,000+ hadoop servers, 100,000+ daily hadoop jobs,10M+ daily hadoop tasks Parquet is a columnar storage format for Hadoop https://parquet.incubator.apache.org Scalding is our Scala DSL for writing Hadoop jobs https://github.com/twitter/scalding ! ! fin
  • 24. Parquet/Scalding at Twitter Parquet* is a columnar storage format Initially a collaboration between Twitter/Cloudera Inspired by Google Dremel paper** Now at Apache: http://parquet.incubator.apache.org/ ! Scalding built on top of Scala and Cascading https://github.com/Cascading/cascading Makes it easier* to write Hadoop jobs (using Scala) *https://blog.twitter.com/2013/announcing-parquet-10-columnar-storage-for-hadoop
  • 25. Scalding Example import com.twitter.scalding._! ! // can’t have a Hadoop example without word count!! class WordCountJob(args : Args) extends Job(args) {! TextLine( args("input") )! .flatMap('line -> 'word) { line : String => line.split("""s+""") }! .groupBy('word) { _.size }! .write( Tsv( args("output") ) )! } https://github.com/twitter/scalding/wiki/Rosetta-Code
  • 26. Life of a Tweet What open source technology do we use behind the scenes when we tweet? tweet write fanout search batch fin
  • 27. Sharing is caring, contribute! Lets all make Twitter better! ! ! ! opensource.twitter.com https://github.com/twitter
  • 28. New Open Source API Samples Hack on the samples and improve them! https://github.com/twitterdev (t.co/code) ! Also, later today check out the lightning talk by Andrew Noonan later about the “Twitter’s developer toolbox” !
  • 30. Q&A The Open Source Behind the Tweets http://opensource.twitter.com ! Hope you learned something new! Come see us at the @TwitterOSS Booth! Chris Aniszczyk (@cra)
  • 31. Resources https://opensource.twitter.com https://github.com/twitter/finagle https://github.com/twitter/zipkin https://github.com/twitter/scalding https://github.com/twitter/mysql https://github.com/twitter/twemproxy https://twitter.github.io/scala_school http://webscalesql.org http://mesos.apache.org http://parquet.incubator.apache.org !
  • 32. Backup Slides October 22, 2014 #twitterflight
  • 33. Where does it all run? Main concept: Datacenter as a computer Aggregation and not virtualization ! ! ! mesos.apache.org framework offer hostname 4 CPUs 4 GB RAM offer hostname 4 CPUs 4 GB RAM offer hostname 4 CPUs 4 GB RAM offer hostname 4 CPUs 4 GB RAM masters aurora.incubator.apache.org
  • 34. Profiles Search / S&R Trends / S&R Home timeline / TLS PTw / Ads Compose Contact import / Growth DMs / Social Discover / S&R WtF / S&R