SlideShare a Scribd company logo
1 of 52
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell – Scaling Mobile Games
Heikki Verta
Services Team Lead
Supercell
G A M 3 0 1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Outline
Supercell team structure and culture
Scaling games
Scaling analytics
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell intro
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Brawl Stars joining the roster soon
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenge
5 games
Hundreds of Millions active
users
4M Peak concurrents
6000 EC2 instances
300 Databases
Multiple regions
250 people company
20 people in a game team
3 server developers in a game
team
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell team structure and culture
“Best teams make the best games”
Supercell culture deck
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell culture in a nutshell
Small teams
Bottom up - not top down
Independence and responsibility Agile
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell culture implications for AWS architecture
Teams own their AWS account(s)
No separate ops-team
Teams choose their own tech stack
We use AWS managed services to reduce ops burden
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling games
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
High-level game stack
Traditional client-server architecture
Server is implemented in Java
Databases are running MySQL
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scale out instead of up
Up
Out
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enabling scaling out of games
Microservice architecture
Sharding database layer
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservice architecture
Game is split into services
Services run on different
instances
“Microservice light”
Single artefact
One repo
One language
One team
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling out
Amazon EC2 Auto Scaling handle scaling instances
Zookeeper assigns roles to Amazon Elastic Compute Cloud (Amazon EC2)
instances
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling out database layer
Database layer is split into shards
To scale out new shards are added
manually
Shards don’t affect game play
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Database failure recovery
MySQL master node failure breaks
the game for that shard
Databases failures are still handled
manually
Brawl Stars uses Amazon Aurora to
mitigate this
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling analytics
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data culture at Supercell
Analytics can’t make a hit game - but can improve it
Full transparency wrt data inside the company
Data scientist embedded in teams
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics in numbers
~5 TB of data per day
~15B atomic “rows” or events
Total size of data warehouse ~4PB
Sample event
{"type": "level_changed", "account": 2474, "sessionId":
"AAABYr437O0KBSX9AAACwA==", "levelType": "experience", "level": 1,
"timestamp": 1523609760859, "game": "clash-royale"}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics timeline
2012 2018
Game databases
Events Streaming events
Vertica data warehouse Amazon Simple Storage Service (Amazon S3)
data warehouse
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics in the beginning
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data pipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event pipeline, 2012
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event pipeline, 2013
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pro’s and con’s of event pipeline
+ Simple
+ More details then just DB changes
- No realtime access
- Data loss if local disk lost or full
- Only way to consume data is from Amazon S3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Streaming pipeline, late 2013
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Streaming pipeline, late 2013
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Streaming pipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of streaming pipeline
Data is safe from local failures
Realtime access to data
Multiple ways to consume data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Supercell Amazon Kinesis setup
2 main streams
Client events
Server events
Data is partitioned randomly
We lose ordering
Gain uniform load between shards
Clients use KCL to consume streams
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Kinesis dispatching
Challenge:
Main streams are quite large
~200 shards per stream
~100MB/s of data
Streams contain multiple event types
All clients are not interested in all event types
Solution:
Split main streams into applications specific
streams
Application specific streams contain only a
subset of events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics timeline
2012 2018
Game databases
Events Streaming events
Vertica data warehouse Amazon S3 data warehouse
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data warehouse
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ETL and data warehouse in 2013
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenges
Spiky load on cluster
Querying is slowed down during ETL
Scaling up or down takes significant
effort
Storage and compute are tied
together
Even a large columnar database
cluster has its limits
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The goal
Limit the amount of data in Vertica
Separate compute from storage
Separate ETL processing from querying
Maintain single source of truth for data
Utilise the flexibility of the cloud to optimise resource usage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The plan
Amazon S3 as the single source of truth
Data stored as parquet
Amazon EMR for ETL
Vertica only for results (accounts, aggregates and KPI’s)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ETL and data warehouse now
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ETL and data warehouse now
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ETL and data warehouse now
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ETL and data warehouse now
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of current approach
Separation of compute and storage
Amazon EMR scales out to very large data sets
Dedicated and transient clusters for ETL workloads
Familiar environment to data scientists
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics timeline
2012 2018
Game databases
Events Streaming events
Vertica data warehouse Amazon S3 data warehouse
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons learned
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scaling and failure recovery
Scaling is determined by your architecture
Microservice architecture and DB sharding can get you far
Assume that things fail - and take that into account
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Analytics
Separate compute and storage
Focus on the fundamentals
Think about how to define schema
No “data police”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Culture
The best thing about Supercell are the independent teams
The most challenging thing about Supercell are the independent teams
The benefits far outweigh the costs
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Heikki Verta
heikki.verta@supercell.com
Please complete the session
survey in the mobile app.
!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
崇之 清水
 

What's hot (20)

Amazon Redshift 概要 (20分版)
Amazon Redshift 概要 (20分版)Amazon Redshift 概要 (20分版)
Amazon Redshift 概要 (20分版)
 
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...7.	게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
7. 게임 스트리밍 서비스를 위한 아키텍처 - 언리얼 엔진을 중심으로! [레벨 300] - 발표자: 하흥수, 솔루션즈 아키텍트, AWS :...
 
PostgreSQL 12は ここがスゴイ! ~性能改善やpluggable storage engineなどの新機能を徹底解説~ (NTTデータ テクノ...
PostgreSQL 12は ここがスゴイ! ~性能改善やpluggable storage engineなどの新機能を徹底解説~ (NTTデータ テクノ...PostgreSQL 12は ここがスゴイ! ~性能改善やpluggable storage engineなどの新機能を徹底解説~ (NTTデータ テクノ...
PostgreSQL 12は ここがスゴイ! ~性能改善やpluggable storage engineなどの新機能を徹底解説~ (NTTデータ テクノ...
 
20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS Batch20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS Batch
 
Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
Amazon DynamoDB(初心者向け 超速マスター編)JAWSUG大阪
 
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
 
Amazon S3を中心とするデータ分析のベストプラクティス
Amazon S3を中心とするデータ分析のベストプラクティスAmazon S3を中心とするデータ分析のベストプラクティス
Amazon S3を中心とするデータ分析のベストプラクティス
 
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデートAmazon Redshift パフォーマンスチューニングテクニックと最新アップデート
Amazon Redshift パフォーマンスチューニングテクニックと最新アップデート
 
NDC 2016 김태현 - 글로벌 동시 퀵 서버패치 이렇게 구축 했다
NDC 2016 김태현 - 글로벌 동시 퀵 서버패치 이렇게 구축 했다NDC 2016 김태현 - 글로벌 동시 퀵 서버패치 이렇게 구축 했다
NDC 2016 김태현 - 글로벌 동시 퀵 서버패치 이렇게 구축 했다
 
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
 
[2017 Gaming on AWS] GameLift를 통한 실전 DevOps: 세션형 멀티플레이어 게임의 구현부터 운영까지 Step by...
[2017 Gaming on AWS] GameLift를 통한 실전 DevOps: 세션형 멀티플레이어 게임의 구현부터 운영까지 Step by...[2017 Gaming on AWS] GameLift를 통한 실전 DevOps: 세션형 멀티플레이어 게임의 구현부터 운영까지 Step by...
[2017 Gaming on AWS] GameLift를 통한 실전 DevOps: 세션형 멀티플레이어 게임의 구현부터 운영까지 Step by...
 
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
AWS Black Belt Online Seminar 2017 Amazon DynamoDB AWS Black Belt Online Seminar 2017 Amazon DynamoDB
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
 
Tortoise gitで日本語ファイル名を使うときのgitの選択について
Tortoise gitで日本語ファイル名を使うときのgitの選択についてTortoise gitで日本語ファイル名を使うときのgitの選択について
Tortoise gitで日本語ファイル名を使うときのgitの選択について
 
Service worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたちService worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたち
 
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
pg_bigm(ピージー・バイグラム)を用いた全文検索のしくみ(後編)
 
ゼロから始めたE2Eテスト
ゼロから始めたE2Eテストゼロから始めたE2Eテスト
ゼロから始めたE2Eテスト
 
AWSメンテナンス ElastiCache編
AWSメンテナンス ElastiCache編AWSメンテナンス ElastiCache編
AWSメンテナンス ElastiCache編
 
Kinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみたKinesis Firehoseを使ってみた
Kinesis Firehoseを使ってみた
 
いまさら話題のXML
いまさら話題のXMLいまさら話題のXML
いまさら話題のXML
 

Similar to Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018

Similar to Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018 (20)

Building a Data Lake for Your Enterprise, ft. Sysco (STG309) - AWS re:Invent ...
Building a Data Lake for Your Enterprise, ft. Sysco (STG309) - AWS re:Invent ...Building a Data Lake for Your Enterprise, ft. Sysco (STG309) - AWS re:Invent ...
Building a Data Lake for Your Enterprise, ft. Sysco (STG309) - AWS re:Invent ...
 
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
 
BI & Analytics
BI & AnalyticsBI & Analytics
BI & Analytics
 
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
 
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
 
BI & Analytics - A Datalake on AWS
BI & Analytics - A Datalake on AWSBI & Analytics - A Datalake on AWS
BI & Analytics - A Datalake on AWS
 
Building Data Lake on AWS | AWS Floor28
Building Data Lake on AWS | AWS Floor28Building Data Lake on AWS | AWS Floor28
Building Data Lake on AWS | AWS Floor28
 
AWS Floor 28 - Building Data lake on AWS
AWS Floor 28 - Building Data lake on AWSAWS Floor 28 - Building Data lake on AWS
AWS Floor 28 - Building Data lake on AWS
 
Modern Cloud Data Warehousing ft. Equinox Fitness Clubs: Optimize Analytics P...
Modern Cloud Data Warehousing ft. Equinox Fitness Clubs: Optimize Analytics P...Modern Cloud Data Warehousing ft. Equinox Fitness Clubs: Optimize Analytics P...
Modern Cloud Data Warehousing ft. Equinox Fitness Clubs: Optimize Analytics P...
 
Get to Know Your Customers - Build and Innovate with a Modern Data Architecture
Get to Know Your Customers - Build and Innovate with a Modern Data ArchitectureGet to Know Your Customers - Build and Innovate with a Modern Data Architecture
Get to Know Your Customers - Build and Innovate with a Modern Data Architecture
 
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
 
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
 
Using Tableau and AWS for Fearless Reporting at UMD
Using Tableau and AWS for Fearless Reporting at UMDUsing Tableau and AWS for Fearless Reporting at UMD
Using Tableau and AWS for Fearless Reporting at UMD
 
Build and Innovate with a Modern Data Architecture
Build and Innovate with a Modern Data ArchitectureBuild and Innovate with a Modern Data Architecture
Build and Innovate with a Modern Data Architecture
 
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
Driving Machine Learning and Analytics Use Cases with AWS Storage (STG302) - ...
 
Quickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scaleQuickly and easily build, train, and deploy machine learning models at any scale
Quickly and easily build, train, and deploy machine learning models at any scale
 
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
 
Emerging Trends in Big Data, Analytics, Machine Learning, and Internet-of-Thi...
Emerging Trends in Big Data, Analytics, Machine Learning, and Internet-of-Thi...Emerging Trends in Big Data, Analytics, Machine Learning, and Internet-of-Thi...
Emerging Trends in Big Data, Analytics, Machine Learning, and Internet-of-Thi...
 
Big Data@Scale_AWSPSSummit_Singapore
Big Data@Scale_AWSPSSummit_SingaporeBig Data@Scale_AWSPSSummit_Singapore
Big Data@Scale_AWSPSSummit_Singapore
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell – Scaling Mobile Games Heikki Verta Services Team Lead Supercell G A M 3 0 1
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Outline Supercell team structure and culture Scaling games Scaling analytics
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell intro
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Brawl Stars joining the roster soon
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenge 5 games Hundreds of Millions active users 4M Peak concurrents 6000 EC2 instances 300 Databases Multiple regions 250 people company 20 people in a game team 3 server developers in a game team
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell team structure and culture
  • 9. “Best teams make the best games” Supercell culture deck
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell culture in a nutshell Small teams Bottom up - not top down Independence and responsibility Agile
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell culture implications for AWS architecture Teams own their AWS account(s) No separate ops-team Teams choose their own tech stack We use AWS managed services to reduce ops burden
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling games
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. High-level game stack Traditional client-server architecture Server is implemented in Java Databases are running MySQL
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scale out instead of up Up Out
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Enabling scaling out of games Microservice architecture Sharding database layer
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Microservice architecture Game is split into services Services run on different instances “Microservice light” Single artefact One repo One language One team
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling out Amazon EC2 Auto Scaling handle scaling instances Zookeeper assigns roles to Amazon Elastic Compute Cloud (Amazon EC2) instances
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling out database layer Database layer is split into shards To scale out new shards are added manually Shards don’t affect game play
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Database failure recovery MySQL master node failure breaks the game for that shard Databases failures are still handled manually Brawl Stars uses Amazon Aurora to mitigate this
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling analytics
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data culture at Supercell Analytics can’t make a hit game - but can improve it Full transparency wrt data inside the company Data scientist embedded in teams
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics in numbers ~5 TB of data per day ~15B atomic “rows” or events Total size of data warehouse ~4PB Sample event {"type": "level_changed", "account": 2474, "sessionId": "AAABYr437O0KBSX9AAACwA==", "levelType": "experience", "level": 1, "timestamp": 1523609760859, "game": "clash-royale"}
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics timeline 2012 2018 Game databases Events Streaming events Vertica data warehouse Amazon Simple Storage Service (Amazon S3) data warehouse
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics in the beginning
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data pipeline
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event pipeline, 2012
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event pipeline, 2013
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pro’s and con’s of event pipeline + Simple + More details then just DB changes - No realtime access - Data loss if local disk lost or full - Only way to consume data is from Amazon S3
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Streaming pipeline, late 2013
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Streaming pipeline, late 2013
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Streaming pipeline
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Benefits of streaming pipeline Data is safe from local failures Realtime access to data Multiple ways to consume data
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Supercell Amazon Kinesis setup 2 main streams Client events Server events Data is partitioned randomly We lose ordering Gain uniform load between shards Clients use KCL to consume streams
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Kinesis dispatching Challenge: Main streams are quite large ~200 shards per stream ~100MB/s of data Streams contain multiple event types All clients are not interested in all event types Solution: Split main streams into applications specific streams Application specific streams contain only a subset of events
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics timeline 2012 2018 Game databases Events Streaming events Vertica data warehouse Amazon S3 data warehouse
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data warehouse
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ETL and data warehouse in 2013
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenges Spiky load on cluster Querying is slowed down during ETL Scaling up or down takes significant effort Storage and compute are tied together Even a large columnar database cluster has its limits
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The goal Limit the amount of data in Vertica Separate compute from storage Separate ETL processing from querying Maintain single source of truth for data Utilise the flexibility of the cloud to optimise resource usage
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The plan Amazon S3 as the single source of truth Data stored as parquet Amazon EMR for ETL Vertica only for results (accounts, aggregates and KPI’s)
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ETL and data warehouse now
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ETL and data warehouse now
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ETL and data warehouse now
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ETL and data warehouse now
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Benefits of current approach Separation of compute and storage Amazon EMR scales out to very large data sets Dedicated and transient clusters for ETL workloads Familiar environment to data scientists
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics timeline 2012 2018 Game databases Events Streaming events Vertica data warehouse Amazon S3 data warehouse
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons learned
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scaling and failure recovery Scaling is determined by your architecture Microservice architecture and DB sharding can get you far Assume that things fail - and take that into account
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Analytics Separate compute and storage Focus on the fundamentals Think about how to define schema No “data police”
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Culture The best thing about Supercell are the independent teams The most challenging thing about Supercell are the independent teams The benefits far outweigh the costs
  • 51. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Heikki Verta heikki.verta@supercell.com
  • 52. Please complete the session survey in the mobile app. ! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.