SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Under the hood,
The new Twitch API
Introductions
JN Vollmer
Engineering Manager, API Infrastructure
Jos Kraaijeveld
Engineering Manager, API Platform
Chris Gamble
Senior Software Engineer, API Platform
#TwitchDevDay
Agenda
Where we are now
What we built, and Why
Where we’re going
1
2
3
#TwitchDevDay
Where we are now
#TwitchDevDay
Where we are now
Facts about the Twitch API
	
70,000 requests per second on average
200,000+ requests per second peak
25,000+ client applications daily
200ms p99 internal response time on average
#TwitchDevDay
Where we are now
You’re already using the Twitch API
If you have ever used Twitch, you’ve used a product
powered by the API
Desktop Website
Mobile Website
Desktop App
Mobile Apps
Console apps
Broadcasters also use the API daily
Overlay alerts
Subscriber only chatrooms
Chat bots
#TwitchDevDay
Where we are now
Evolution of API Philosophy
1st party vs 3rd party API
Different requirements
Different constraints, SLA
Different policies
V1 was released in 2012
Better standards for data exchange with
internal products
Enabled a burgeoning ecosystem
#TwitchDevDay
Where we are now
Evolution of API Philosophy
API team formed in early 2016
More direct external developer advocacy
In parallel, Twitch transformed its engineering stack from rails
monolith to Go microservices
These services needed a canonical way to expose their data
➔ Birth of our API Platform: Visage
#TwitchDevDay
Where we are now
Visage, an extensible platform, is the pedestal that enables:
/Helix (the new Twitch API) in its current form:
Users
Streams
Follows
Love letter to the Developers
Consistency
Full Transparency
Reliability
New modern, faster end-user experiences:
The new beta Twitch Website
Mobile native and web clients
Extensions
Twitch integration in Games…
#TwitchDevDay
Visage: Twitch API Gateway
#TwitchDevDay
Handles all incoming API requests
Visage: Twitch API Gateway
What it does
Performs common operations
Parsing
Authentication
Ratelimiting
Cache headers, CORS, UTF8, SSL, Locale, etc
Routes to versioned endpoints
Endpoints make service calls
Calls automatically use a shared cache
Formats response
#TwitchDevDay
Visage: Twitch API Gateway
Why not use an existing gateway?
Existing gateways are pass-throughs, they
make one data call per request


Visage is an aggregator, it makes multiple
data calls per request
#TwitchDevDay
Visage: Twitch API Gateway
The Visage API Gateway: Benefits
Benefits compared to our older Rails stack:
Provides great latency reduction
Scales better, both horizontally and vertically
Simpler to understand
Well defined ownership for endpoints
#TwitchDevDay
Visage: Twitch API Gateway
Core components
Built on Go
Uses the latest version of Go
Lots of expertise about Go quirks within Twitch (see
our blog!)
Stateless Architecture utilizing AWS services
Application Load Balancers
Elastic Beanstalk
Elasticache
Xray tracing
Puppet for configuration and host setup

Local DNS resolvers to decrease latency and increase
availability
#TwitchDevDay
Visage: Twitch API Gateway
Data Aggregation
Each API request makes at least two service calls, potentially dozens
Almost all service calls are preceded by a cache lookup
Every service and cache call is wrapped in Hystrix to protect against downstream failure
Service calls primarily use Twirp (Twitch RPC) to auto-generate client & server stubs from protobuf
#TwitchDevDay
Visage: Twitch API Gateway
Rate Limiting
Only applies to Helix endpoints

Memcached as a backing store
Keys look like “ip-127.0.0.1-1507932905”
Each bucket stores number of requests per 5 second period
To determine usage we add up the twelve buckets in the last minute

Authed requests are limited by Client-ID, Unauthed by IP
#TwitchDevDay
Visage: Twitch API Gateway
Integrations
Swagger API definitions
Automatic documentation generation
Machine readable
End to end tests using Runscope
Runs on deploys to catch breaking changes
Auto generated from Swagger definitions
Metrics emitted to StatusPage.io (devstatus.twitch.tv)
Proxies internal graphite metrics via their API
#TwitchDevDay
Visage: Twitch API Gateway
The Other Bits
Other features:
SSL enforcement
Authorization
Authentication
CORS
JSON-P
Tons of metrics and logs
NO Business Logic!
#TwitchDevDay
Where we’re going
#TwitchDevDay
Where we’re going
The future of Visage API Gateway
Webhooks:
First Announced Today!
Removes the need for polling
Adheres to the w3 WebSub spec
Once the Webhooks platform is online,
more Webhooks endpoints will get
added in upcoming months
#TwitchDevDay
Where we’re going
The future of Visage API Gateway
GraphQL:

One call to rule them all!
In full experiment mode, very promising
Used internally already
Architecture and principles mesh very well with our
world of microservices + data aggregating Gateway
Latency latency latency
The future of APIs in general (remember SOAP?), but
still a nascent technology
GraphQL summit on its 2nd iteration only
#TwitchDevDay
Where we’re going
The future of Visage API Gateway
Multi Region APIs:
Aka multi data centers
Serving API behind a mix of CDNs is not enough
Latency + Higher availability
Complex project with 100s of microservices
- Deploy complexity ! CI/CD
- Caching strategies
- Data store replication and policies
- Partial Failures and degradation modes
#TwitchDevDay
Where we’re going
The future of Visage API Gateway
New Helix endpoints, including new Twitch
features:
Games
VODs
Clips
More Webhooks
…
Continuous internal DevEx improvements:
Make it easier, safer and faster to add endpoints
The platform is never complete
#TwitchDevDay
Summary
The Twitch API journey
Visage, the API platform:
Enables Helix for 3rd party developers
Supports 1st party clients as well
Supports experiments of new technologies and
services
Is continuously improved (code and infra) for
internal and external DevEx
Thank you

Contenu connexe

Tendances

PTE Exam | PTE Coaching
PTE Exam | PTE CoachingPTE Exam | PTE Coaching
PTE Exam | PTE CoachingAussizz Group
 
All about IELTS EXAM Preparation and coaching
All about IELTS EXAM Preparation and coachingAll about IELTS EXAM Preparation and coaching
All about IELTS EXAM Preparation and coachingKnowYourTutor.com
 
IELTS Reading - Short Answer Questions
 IELTS Reading - Short Answer Questions IELTS Reading - Short Answer Questions
IELTS Reading - Short Answer QuestionstheLecturette
 
IELTS Listening - Matching Information - Introduction - Useful Tips
IELTS Listening - Matching Information - Introduction - Useful TipsIELTS Listening - Matching Information - Introduction - Useful Tips
IELTS Listening - Matching Information - Introduction - Useful TipsIELTSBackup
 
IELTS Listening - Flow Chart Completion - Introduction and Useful Tips
IELTS Listening - Flow Chart Completion - Introduction and Useful TipsIELTS Listening - Flow Chart Completion - Introduction and Useful Tips
IELTS Listening - Flow Chart Completion - Introduction and Useful TipsIELTSBackup
 
Life sciences p1 gr 12 exemplar 2014 memo eng
Life sciences p1 gr 12 exemplar 2014 memo engLife sciences p1 gr 12 exemplar 2014 memo eng
Life sciences p1 gr 12 exemplar 2014 memo engElizabeth Sweatman
 
Презентация вебинара "Подготовка к IELTS"
Презентация вебинара "Подготовка к IELTS"Презентация вебинара "Подготовка к IELTS"
Презентация вебинара "Подготовка к IELTS"Anastasia Gavrish
 
Ieltsorientationppt
IeltsorientationpptIeltsorientationppt
IeltsorientationpptScott Benson
 
IELTS Exam Structure 2017- IELTS Test Aid
IELTS Exam Structure 2017- IELTS Test AidIELTS Exam Structure 2017- IELTS Test Aid
IELTS Exam Structure 2017- IELTS Test AidIELTS Test Aid
 
Toefl introduction
Toefl introductionToefl introduction
Toefl introductionKenglsih
 
O-net English Exam
O-net English ExamO-net English Exam
O-net English ExamSuchittra Ch
 
IELTS Online Exam and Test Format
IELTS Online Exam and Test FormatIELTS Online Exam and Test Format
IELTS Online Exam and Test FormatDenisha Joely
 
Class 4 Cbse English Question Paper FA 2
Class 4 Cbse English Question Paper FA 2Class 4 Cbse English Question Paper FA 2
Class 4 Cbse English Question Paper FA 2Sunaina Rawat
 
IELTS Speaking Part 2.pptx
IELTS Speaking Part 2.pptxIELTS Speaking Part 2.pptx
IELTS Speaking Part 2.pptxDipak Bohara
 
Road to the ielts journey
Road to the ielts journeyRoad to the ielts journey
Road to the ielts journeySunna Chowdhury
 

Tendances (20)

PTE Exam | PTE Coaching
PTE Exam | PTE CoachingPTE Exam | PTE Coaching
PTE Exam | PTE Coaching
 
All about IELTS EXAM Preparation and coaching
All about IELTS EXAM Preparation and coachingAll about IELTS EXAM Preparation and coaching
All about IELTS EXAM Preparation and coaching
 
Ielts speaking format
Ielts speaking formatIelts speaking format
Ielts speaking format
 
IELTS Reading - Short Answer Questions
 IELTS Reading - Short Answer Questions IELTS Reading - Short Answer Questions
IELTS Reading - Short Answer Questions
 
IELTS Listening - Matching Information - Introduction - Useful Tips
IELTS Listening - Matching Information - Introduction - Useful TipsIELTS Listening - Matching Information - Introduction - Useful Tips
IELTS Listening - Matching Information - Introduction - Useful Tips
 
IELTS Listening - Flow Chart Completion - Introduction and Useful Tips
IELTS Listening - Flow Chart Completion - Introduction and Useful TipsIELTS Listening - Flow Chart Completion - Introduction and Useful Tips
IELTS Listening - Flow Chart Completion - Introduction and Useful Tips
 
Life sciences p1 gr 12 exemplar 2014 memo eng
Life sciences p1 gr 12 exemplar 2014 memo engLife sciences p1 gr 12 exemplar 2014 memo eng
Life sciences p1 gr 12 exemplar 2014 memo eng
 
Презентация вебинара "Подготовка к IELTS"
Презентация вебинара "Подготовка к IELTS"Презентация вебинара "Подготовка к IELTS"
Презентация вебинара "Подготовка к IELTS"
 
Ieltsorientationppt
IeltsorientationpptIeltsorientationppt
Ieltsorientationppt
 
Ielts workshop
Ielts workshopIelts workshop
Ielts workshop
 
IELTS Exam Structure 2017- IELTS Test Aid
IELTS Exam Structure 2017- IELTS Test AidIELTS Exam Structure 2017- IELTS Test Aid
IELTS Exam Structure 2017- IELTS Test Aid
 
Ielts presentation for teachers
Ielts presentation for teachersIelts presentation for teachers
Ielts presentation for teachers
 
Toefl introduction
Toefl introductionToefl introduction
Toefl introduction
 
IELTS Reading Overview
IELTS Reading OverviewIELTS Reading Overview
IELTS Reading Overview
 
O-net English Exam
O-net English ExamO-net English Exam
O-net English Exam
 
IELTS Online Exam and Test Format
IELTS Online Exam and Test FormatIELTS Online Exam and Test Format
IELTS Online Exam and Test Format
 
Class 4 Cbse English Question Paper FA 2
Class 4 Cbse English Question Paper FA 2Class 4 Cbse English Question Paper FA 2
Class 4 Cbse English Question Paper FA 2
 
IELTS Speaking Part 2.pptx
IELTS Speaking Part 2.pptxIELTS Speaking Part 2.pptx
IELTS Speaking Part 2.pptx
 
TOEFL Presentation
TOEFL PresentationTOEFL Presentation
TOEFL Presentation
 
Road to the ielts journey
Road to the ielts journeyRoad to the ielts journey
Road to the ielts journey
 

Similaire à Under the Hood of the New Twitch API - TwitchCon Developer Day 2017

Azure functions
Azure functionsAzure functions
Azure functionsvivek p s
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterAmazon Web Services
 
Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)Ido Green
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with GrailsTanausu Cerdeña
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc projectAlexandre Gouaillard
 
Building Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR ServiceBuilding Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR ServiceJalpesh Vadgama
 
Agile Code Reviews: Supporting collaboration and improving production uptime ...
Agile Code Reviews: Supporting collaboration and improving production uptime ...Agile Code Reviews: Supporting collaboration and improving production uptime ...
Agile Code Reviews: Supporting collaboration and improving production uptime ...Atlassian
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB
 
Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Daniel Jacobson
 
Funky serverless features at aws
Funky serverless features at awsFunky serverless features at aws
Funky serverless features at awsDoug Winter
 
Slaying Monoliths with Node and Docker
Slaying Monoliths with Node and DockerSlaying Monoliths with Node and Docker
Slaying Monoliths with Node and DockerYunong Xiao
 
Spring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application ServiceSpring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application ServiceVMware Tanzu
 
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopApigee | Google Cloud
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetupShubhra Kar
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API GatewayMark Bate
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
Will the Real Public API Please Stand Up? Amir Zuker
Will the Real Public API Please Stand Up? Amir ZukerWill the Real Public API Please Stand Up? Amir Zuker
Will the Real Public API Please Stand Up? Amir ZukerCodeValue
 

Similaire à Under the Hood of the New Twitch API - TwitchCon Developer Day 2017 (20)

Azure functions
Azure functionsAzure functions
Azure functions
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver Faster
 
Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)
 
Building a scalable API with Grails
Building a scalable API with GrailsBuilding a scalable API with Grails
Building a scalable API with Grails
 
DYI - Starting your own webrtc project
DYI - Starting your own webrtc projectDYI - Starting your own webrtc project
DYI - Starting your own webrtc project
 
Building Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR ServiceBuilding Real time Application with Azure SignalR Service
Building Real time Application with Azure SignalR Service
 
Serverless everywhere
Serverless everywhereServerless everywhere
Serverless everywhere
 
Agile Code Reviews: Supporting collaboration and improving production uptime ...
Agile Code Reviews: Supporting collaboration and improving production uptime ...Agile Code Reviews: Supporting collaboration and improving production uptime ...
Agile Code Reviews: Supporting collaboration and improving production uptime ...
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016
 
Intro to signalR
Intro to signalRIntro to signalR
Intro to signalR
 
Funky serverless features at aws
Funky serverless features at awsFunky serverless features at aws
Funky serverless features at aws
 
Slaying Monoliths with Node and Docker
Slaying Monoliths with Node and DockerSlaying Monoliths with Node and Docker
Slaying Monoliths with Node and Docker
 
Spring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application ServiceSpring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application Service
 
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
 
Toronto node js_meetup
Toronto node js_meetupToronto node js_meetup
Toronto node js_meetup
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Will the Real Public API Please Stand Up? Amir Zuker
Will the Real Public API Please Stand Up? Amir ZukerWill the Real Public API Please Stand Up? Amir Zuker
Will the Real Public API Please Stand Up? Amir Zuker
 
Public API
Public APIPublic API
Public API
 

Plus de Twitch Developers

Embracing the Hobbyist Persona
Embracing the Hobbyist PersonaEmbracing the Hobbyist Persona
Embracing the Hobbyist PersonaTwitch Developers
 
Using Insights to Build Better Products and Grow on Twitch
Using Insights to Build Better Products and Grow on TwitchUsing Insights to Build Better Products and Grow on Twitch
Using Insights to Build Better Products and Grow on TwitchTwitch Developers
 
Building Extensions With You
Building Extensions With YouBuilding Extensions With You
Building Extensions With YouTwitch Developers
 
TwitchCon Developer Day Keynote
TwitchCon Developer Day KeynoteTwitchCon Developer Day Keynote
TwitchCon Developer Day KeynoteTwitch Developers
 
Rapid Prototyping Twitch Extensions: Five Lessons Learned
Rapid Prototyping Twitch Extensions: Five Lessons LearnedRapid Prototyping Twitch Extensions: Five Lessons Learned
Rapid Prototyping Twitch Extensions: Five Lessons LearnedTwitch Developers
 
Monetize Your Extension a Bit at a Time
Monetize Your Extension a Bit at a TimeMonetize Your Extension a Bit at a Time
Monetize Your Extension a Bit at a TimeTwitch Developers
 
Twitch Extension Review Process: The Missing Manual
Twitch Extension Review Process: The Missing ManualTwitch Extension Review Process: The Missing Manual
Twitch Extension Review Process: The Missing ManualTwitch Developers
 
Responding to Feedback: What's New in the Twitch API
Responding to Feedback: What's New in the Twitch APIResponding to Feedback: What's New in the Twitch API
Responding to Feedback: What's New in the Twitch APITwitch Developers
 
Making Your Game a Success With Twitch
Making Your Game a Success With TwitchMaking Your Game a Success With Twitch
Making Your Game a Success With TwitchTwitch Developers
 
Extension Design Patterns for Twitch Scale
Extension Design Patterns for Twitch ScaleExtension Design Patterns for Twitch Scale
Extension Design Patterns for Twitch ScaleTwitch Developers
 
Get Your Extension Discovered
Get Your Extension DiscoveredGet Your Extension Discovered
Get Your Extension DiscoveredTwitch Developers
 
Bots Bots Bots: Building Chatbots
Bots Bots Bots: Building ChatbotsBots Bots Bots: Building Chatbots
Bots Bots Bots: Building ChatbotsTwitch Developers
 
How Streaming is Changing the Way We Play
How Streaming is Changing the Way We PlayHow Streaming is Changing the Way We Play
How Streaming is Changing the Way We PlayTwitch Developers
 
Twitch Insights: Player Research and Interaction
Twitch Insights: Player Research and InteractionTwitch Insights: Player Research and Interaction
Twitch Insights: Player Research and InteractionTwitch Developers
 
Using Twitch Drops to Promote Viewer Engagement
Using Twitch Drops to Promote Viewer Engagement Using Twitch Drops to Promote Viewer Engagement
Using Twitch Drops to Promote Viewer Engagement Twitch Developers
 
Twitch Extensions: Live Apps for Live Streams
Twitch Extensions: Live Apps for Live StreamsTwitch Extensions: Live Apps for Live Streams
Twitch Extensions: Live Apps for Live StreamsTwitch Developers
 

Plus de Twitch Developers (20)

Embracing the Hobbyist Persona
Embracing the Hobbyist PersonaEmbracing the Hobbyist Persona
Embracing the Hobbyist Persona
 
Using Insights to Build Better Products and Grow on Twitch
Using Insights to Build Better Products and Grow on TwitchUsing Insights to Build Better Products and Grow on Twitch
Using Insights to Build Better Products and Grow on Twitch
 
Twitch for Game Developers
Twitch for Game DevelopersTwitch for Game Developers
Twitch for Game Developers
 
Building Extensions With You
Building Extensions With YouBuilding Extensions With You
Building Extensions With You
 
TwitchCon Developer Day Keynote
TwitchCon Developer Day KeynoteTwitchCon Developer Day Keynote
TwitchCon Developer Day Keynote
 
Twitch Extensions 101
Twitch Extensions 101Twitch Extensions 101
Twitch Extensions 101
 
Rapid Prototyping Twitch Extensions: Five Lessons Learned
Rapid Prototyping Twitch Extensions: Five Lessons LearnedRapid Prototyping Twitch Extensions: Five Lessons Learned
Rapid Prototyping Twitch Extensions: Five Lessons Learned
 
Monetize Your Extension a Bit at a Time
Monetize Your Extension a Bit at a TimeMonetize Your Extension a Bit at a Time
Monetize Your Extension a Bit at a Time
 
Twitch Extension Review Process: The Missing Manual
Twitch Extension Review Process: The Missing ManualTwitch Extension Review Process: The Missing Manual
Twitch Extension Review Process: The Missing Manual
 
Responding to Feedback: What's New in the Twitch API
Responding to Feedback: What's New in the Twitch APIResponding to Feedback: What's New in the Twitch API
Responding to Feedback: What's New in the Twitch API
 
Making Your Game a Success With Twitch
Making Your Game a Success With TwitchMaking Your Game a Success With Twitch
Making Your Game a Success With Twitch
 
Extension Design Patterns for Twitch Scale
Extension Design Patterns for Twitch ScaleExtension Design Patterns for Twitch Scale
Extension Design Patterns for Twitch Scale
 
Get Your Extension Discovered
Get Your Extension DiscoveredGet Your Extension Discovered
Get Your Extension Discovered
 
Bots Bots Bots: Building Chatbots
Bots Bots Bots: Building ChatbotsBots Bots Bots: Building Chatbots
Bots Bots Bots: Building Chatbots
 
Twitch Developer Tour
Twitch Developer Tour Twitch Developer Tour
Twitch Developer Tour
 
How Streaming is Changing the Way We Play
How Streaming is Changing the Way We PlayHow Streaming is Changing the Way We Play
How Streaming is Changing the Way We Play
 
Twitch Insights: Player Research and Interaction
Twitch Insights: Player Research and InteractionTwitch Insights: Player Research and Interaction
Twitch Insights: Player Research and Interaction
 
Twitch + Games
Twitch + GamesTwitch + Games
Twitch + Games
 
Using Twitch Drops to Promote Viewer Engagement
Using Twitch Drops to Promote Viewer Engagement Using Twitch Drops to Promote Viewer Engagement
Using Twitch Drops to Promote Viewer Engagement
 
Twitch Extensions: Live Apps for Live Streams
Twitch Extensions: Live Apps for Live StreamsTwitch Extensions: Live Apps for Live Streams
Twitch Extensions: Live Apps for Live Streams
 

Dernier

Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxBipin Adhikari
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 

Dernier (20)

Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptx
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 

Under the Hood of the New Twitch API - TwitchCon Developer Day 2017

  • 1. Under the hood, The new Twitch API
  • 2. Introductions JN Vollmer Engineering Manager, API Infrastructure Jos Kraaijeveld Engineering Manager, API Platform Chris Gamble Senior Software Engineer, API Platform
  • 3. #TwitchDevDay Agenda Where we are now What we built, and Why Where we’re going 1 2 3
  • 5. #TwitchDevDay Where we are now Facts about the Twitch API 70,000 requests per second on average 200,000+ requests per second peak 25,000+ client applications daily 200ms p99 internal response time on average
  • 6. #TwitchDevDay Where we are now You’re already using the Twitch API If you have ever used Twitch, you’ve used a product powered by the API Desktop Website Mobile Website Desktop App Mobile Apps Console apps Broadcasters also use the API daily Overlay alerts Subscriber only chatrooms Chat bots
  • 7. #TwitchDevDay Where we are now Evolution of API Philosophy 1st party vs 3rd party API Different requirements Different constraints, SLA Different policies V1 was released in 2012 Better standards for data exchange with internal products Enabled a burgeoning ecosystem
  • 8. #TwitchDevDay Where we are now Evolution of API Philosophy API team formed in early 2016 More direct external developer advocacy In parallel, Twitch transformed its engineering stack from rails monolith to Go microservices These services needed a canonical way to expose their data ➔ Birth of our API Platform: Visage
  • 9. #TwitchDevDay Where we are now Visage, an extensible platform, is the pedestal that enables: /Helix (the new Twitch API) in its current form: Users Streams Follows Love letter to the Developers Consistency Full Transparency Reliability New modern, faster end-user experiences: The new beta Twitch Website Mobile native and web clients Extensions Twitch integration in Games…
  • 11. #TwitchDevDay Handles all incoming API requests Visage: Twitch API Gateway What it does Performs common operations Parsing Authentication Ratelimiting Cache headers, CORS, UTF8, SSL, Locale, etc Routes to versioned endpoints Endpoints make service calls Calls automatically use a shared cache Formats response
  • 12. #TwitchDevDay Visage: Twitch API Gateway Why not use an existing gateway? Existing gateways are pass-throughs, they make one data call per request 
 Visage is an aggregator, it makes multiple data calls per request
  • 13. #TwitchDevDay Visage: Twitch API Gateway The Visage API Gateway: Benefits Benefits compared to our older Rails stack: Provides great latency reduction Scales better, both horizontally and vertically Simpler to understand Well defined ownership for endpoints
  • 14. #TwitchDevDay Visage: Twitch API Gateway Core components Built on Go Uses the latest version of Go Lots of expertise about Go quirks within Twitch (see our blog!) Stateless Architecture utilizing AWS services Application Load Balancers Elastic Beanstalk Elasticache Xray tracing Puppet for configuration and host setup
 Local DNS resolvers to decrease latency and increase availability
  • 15. #TwitchDevDay Visage: Twitch API Gateway Data Aggregation Each API request makes at least two service calls, potentially dozens Almost all service calls are preceded by a cache lookup Every service and cache call is wrapped in Hystrix to protect against downstream failure Service calls primarily use Twirp (Twitch RPC) to auto-generate client & server stubs from protobuf
  • 16. #TwitchDevDay Visage: Twitch API Gateway Rate Limiting Only applies to Helix endpoints
 Memcached as a backing store Keys look like “ip-127.0.0.1-1507932905” Each bucket stores number of requests per 5 second period To determine usage we add up the twelve buckets in the last minute
 Authed requests are limited by Client-ID, Unauthed by IP
  • 17. #TwitchDevDay Visage: Twitch API Gateway Integrations Swagger API definitions Automatic documentation generation Machine readable End to end tests using Runscope Runs on deploys to catch breaking changes Auto generated from Swagger definitions Metrics emitted to StatusPage.io (devstatus.twitch.tv) Proxies internal graphite metrics via their API
  • 18. #TwitchDevDay Visage: Twitch API Gateway The Other Bits Other features: SSL enforcement Authorization Authentication CORS JSON-P Tons of metrics and logs NO Business Logic!
  • 20. #TwitchDevDay Where we’re going The future of Visage API Gateway Webhooks: First Announced Today! Removes the need for polling Adheres to the w3 WebSub spec Once the Webhooks platform is online, more Webhooks endpoints will get added in upcoming months
  • 21. #TwitchDevDay Where we’re going The future of Visage API Gateway GraphQL:
 One call to rule them all! In full experiment mode, very promising Used internally already Architecture and principles mesh very well with our world of microservices + data aggregating Gateway Latency latency latency The future of APIs in general (remember SOAP?), but still a nascent technology GraphQL summit on its 2nd iteration only
  • 22. #TwitchDevDay Where we’re going The future of Visage API Gateway Multi Region APIs: Aka multi data centers Serving API behind a mix of CDNs is not enough Latency + Higher availability Complex project with 100s of microservices - Deploy complexity ! CI/CD - Caching strategies - Data store replication and policies - Partial Failures and degradation modes
  • 23. #TwitchDevDay Where we’re going The future of Visage API Gateway New Helix endpoints, including new Twitch features: Games VODs Clips More Webhooks … Continuous internal DevEx improvements: Make it easier, safer and faster to add endpoints The platform is never complete
  • 24. #TwitchDevDay Summary The Twitch API journey Visage, the API platform: Enables Helix for 3rd party developers Supports 1st party clients as well Supports experiments of new technologies and services Is continuously improved (code and infra) for internal and external DevEx