SlideShare a Scribd company logo
1 of 25
Download to read offline
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

More Related Content

What's hot

La canción criolla
La canción criollaLa canción criolla
La canción criollaChristyLeyva
 
BioGeo11-Replicação do ADN e Síntese Proteica
BioGeo11-Replicação do ADN e Síntese ProteicaBioGeo11-Replicação do ADN e Síntese Proteica
BioGeo11-Replicação do ADN e Síntese ProteicaRita Rainho
 
D9 abi quadro_sintese
D9 abi quadro_sinteseD9 abi quadro_sintese
D9 abi quadro_sintesemiguelribeiro
 
3º eso. la música en grecia (1)
3º eso. la música en grecia (1)3º eso. la música en grecia (1)
3º eso. la música en grecia (1)Lsuarezmera
 
Sermão de santo antonio aos peixes
Sermão de santo antonio aos peixesSermão de santo antonio aos peixes
Sermão de santo antonio aos peixesSusana Taio
 
[Texto 6]uma pequenina luz
[Texto 6]uma pequenina luz[Texto 6]uma pequenina luz
[Texto 6]uma pequenina luzjoaoaparicio
 

What's hot (9)

La canción criolla
La canción criollaLa canción criolla
La canción criolla
 
BioGeo11-Replicação do ADN e Síntese Proteica
BioGeo11-Replicação do ADN e Síntese ProteicaBioGeo11-Replicação do ADN e Síntese Proteica
BioGeo11-Replicação do ADN e Síntese Proteica
 
D9 abi quadro_sintese
D9 abi quadro_sinteseD9 abi quadro_sintese
D9 abi quadro_sintese
 
Vida e Obra de Alice Vieira
Vida e Obra de Alice VieiraVida e Obra de Alice Vieira
Vida e Obra de Alice Vieira
 
3º eso. la música en grecia (1)
3º eso. la música en grecia (1)3º eso. la música en grecia (1)
3º eso. la música en grecia (1)
 
12 sistemática
12   sistemática12   sistemática
12 sistemática
 
CN7 - Fósseis
CN7 - FósseisCN7 - Fósseis
CN7 - Fósseis
 
Sermão de santo antonio aos peixes
Sermão de santo antonio aos peixesSermão de santo antonio aos peixes
Sermão de santo antonio aos peixes
 
[Texto 6]uma pequenina luz
[Texto 6]uma pequenina luz[Texto 6]uma pequenina luz
[Texto 6]uma pequenina luz
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxgalaxypingy
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查ydyuyu
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptxAsmae Rabhi
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsMonica Sydney
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 

Recently uploaded (20)

Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 

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