Escolar Documentos
Profissional Documentos
Cultura Documentos
RIOT
OURGAMES
STORY ENGINEERING
CAREERS GAMES NEWS !
Search...
Search Stories
!
Running
Online
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 1 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
FOUNDATIONAL CHOICES
As mentioned in our previous article, we initially
looked into using existing API management
platforms, such as apiGrove and Repose, but
decided to build our own solution that could be
customized to work for all the different regions,
partners, and technologies in the Riot Games
ecosystem. After doing some research into what
open source solutions were available to support
traffic at our scale, we decided to utilize the Zuul
proxy server developed by Netflix, as well as some
other Netflix projects, including Archaius, Ribbon,
Hystrix, and Eureka. The smart and talented folks
at Netflix built their infrastructure to handle an
enormous amount of constant, high-bandwidth
traffic, so we knew we could trust that the code
was battle-tested and production-hardened.
Netflix Zuul provides a core JAR dependency that
handles HTTP requests and executes filter chains.
Using this dependency as a basis, we wrote some
additional classes to include features we needed,
such as automated health checking, connection
pool management and monitoring, metrics
processing, etc. On top of this core proxy server,
we implemented custom filters to handle things
like authorization, authentication, rate limiting,
dynamic routing, load balancing, metrics
collection, white listing, black listing, and more.
The core proxy server, written in Java, and custom
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 2 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 3 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 4 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
DEVELOPER PORTAL
As mentioned in our previous article, we built a
public Developer Portal to facilitate interaction and
ongoing conversation with third-party developers.
In order to simplify development by leveraging an
existing MVC framework, we built the developer
portal as a Grails application written in Java and
Groovy that runs in Tomcat and utilizes Bootstrap
for the front-end. When users first log in to the
developer portal, a developer account is created
for them. A development application with an
associated API key is automatically created for
them and associated with their account. If a higher
rate limit is needed for a production application,
users can register their project for access to a
production API key. Applications are associated
with a tier, which is a rate limit definition. For
example, a demo tier may be defined as 10 calls
per 10 seconds and 500 calls per 10 minutes.
Having both rate limits tied to a single tier means
that the tier can manage both bursty and
sustained calls. Applications are also tied to
policies, which define a set of API endpoints that
an application may access. In addition to this
application configuration, the API platform relies
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 5 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
PROPAGATING
CONFIGURATION
All of the above-described configuration data for
the API platform, including the automatically
generated accounts, applications, and keys, as
well as the manually configured tiers, policies,
services, endpoints, and APIs, are stored in a
schema in a MySQL database. A lightweight
service called the API Configuration Service is
responsible for providing configuration
information, such as a list of valid API keys, a list of
URIs that the edge server should consider valid,
the physical endpoints to which those URIs should
be routed, the list of URIs on each policy, the
definitions of each rate limit tier, etc.
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 6 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
TECHNOLOGY OVERVIEW
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 7 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 8 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 9 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
queue.
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 10 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
AWS DEPLOYMENT
The Zuul proxy servers are deployed on AWS
instances across 3 VPCs in Tokyo, Ireland, and
NorCal. There are 4 proxy server instances, 2 in
each availability zone in each VPC behind an ELB.
Each VPC also has a set of instances for the Riot
API Metrics and ESRL that the Zuuls in that VPC
utilize. The Riot API Metrics and ESRL also each
use their own Redis, an AWS ElasticCache
instance, in each VPC. The Riot API Metrics in
NorCal is considered the metrics master and is
backed by a MySQL database, an AWS RDS
instance. The Riot API Metrics in Ireland and Tokyo
are considered slaves and when their threads
execute the persistence step to save the metrics
data, they do so by making a REST call to the
master with the DTO serialized into JSON. The
master then saves the data to the database. This
model allows us to save all metrics data from all
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 11 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
CONCLUSION
The edge service and related infrastructure have
continuously evolved over the years since the API
was released. We have made improvements in
performance and reliability, matured the
technology powering the different pieces, and
production-hardened the entire architecture.
Going forward, the edge infrastructure will be
deployed in every Riot Data Center to help
manage ACLs and rate limits, provide an easy
single point of access for all APIs being shared
across services, and leverage all the other
features and benefits the edge provides. As we
roll out the framework to allow the edge to auto-
discover and configure services, it will become an
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 12 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
Comments Community !
1 Login
Sort by Best
Recommend Share
Please, contact us at
nathalia.torezani@imasters.com.br or
alex.lattaro@imasters.com.br.
Thanks,
Adrian
Reply Share
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 15 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
see more
Reply Share
Subscribe
d Add Disqus to your site Add Disqus Add
) Privacy
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 16 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 17 of 18
The Riot Games API: Deep Dive | Riot Games Engineering 23/11/2016, 18*52
https://engineering.riotgames.com/news/riot-games-api-deep-dive Page 18 of 18