SlideShare a Scribd company logo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Web Services Japan K.K.
Solutions Architect Fumihiko Hata
2017.01.24
AWS におけるモバイルゲーム向け
API サーバの実装 2018
AWS Gaming Tech Night #2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容についての注意点
本資料では2017年1⽉24⽇時点のサービス内容および価格についてご説明しています。最新
の情報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。
• 資料作成には⼗分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格
に相違があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。
• 価格は税抜表記となっています。⽇本居住者のお客様が東京リージョンを使⽤する場合、
別途消費税をご請求させていただきます。
AWS does not offer binding price quotes. AWS pricing is publicly available and is
subject to change in accordance with the AWS Customer Agreement available at
http://aws.amazon.com/agreement/. Any pricing information included in this
document is provided only as an estimate of usage charges for AWS services based
on certain information that you have provided. Monthly charges will be based on
your actual use of AWS services, and may vary from the estimates provided.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
モバイルゲームのアーキテクチャと構成要素
API サーバ
実装/アーキテクチャ
Amazon EC2 & ELB (Typical 3-Tier)
Amazon API Gateway & AWS Lambda (Serverless 3-Tier)
Amazon Cognito (Serverless 2-Tier)
AWS AppSync (Managed GraphQL)
まとめ
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
① HTTP API を⽤いてログイン
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
② Game Assets をダウンロード
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
③ Game Serverのマッチメイク
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
④ GameServer へ接続してバトル
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャ例
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
⑤ HTTP API を⽤いて結果を永続化
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3CloudFront
WAF
Shield
ELB
ElastiCache DynamoDB
RDSEC2 Game Servers
EC2 API Servers
Kinesis S3
Redshift
Athena
QuickSight
CognitoRoute53
分析
配信
ネットワーク
セキュリティ
API
ゲーム
共通基盤
Client
RDS
プッシュ通知
Pinpoint
API サーバ
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
モバイルゲームの API サーバ
• ゲーム内の様々なユーザ操作を
処理、保存する
• ログイン、アイテム購⼊、デッキ編
成、バトルのマッチング、etc.
• 処理結果は RDB に永続されること
が多い
• バトルやステージ内での⼀連のゲー
ムプレイ処理は 専⽤のゲームサー
バが受け持つことが多い
• HTTP(S) で RESTful など
• 全ユーザで同⼀のエンドポイント
ELB
ElastiCache DynamoDB
EC2 API Servers
API
RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
モバイルゲームの API サーバに求められるもの
1. 可⽤性
• 落ちるとゲームが進⾏不可に
2. スケーラビリティ
• 全ユーザが単⼀のエンドポイント
3. レスポンス速度
• ゲーム体験に直接的に影響
4. コードのメンテナビリティ
• ⽇々、機能追加・機能修正
• 繰り返されるイベント実装
ELB
ElastiCache DynamoDB
EC2 API Servers
API
RDS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
実装/アーキテクチャ
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1.典型的な3層Webアプリケーション
クライアントは
HTTP(S) で Web サーバ
と通信
サーバサイドは
ELB + EC2 + RDS
Elastic Load Balancing
(以下ELB)
Amazon
Elastic Compute Cloud
(以下EC2)
Amazon
Relational Database Service
(以下RDS)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1.典型的な3層Webアプリケーション
‣ メリット
‣ 実績が多く枯れた構成
‣ カスタマイズ性が⾼い
‣ 場合によっては後述の
サーバレスアーキテク
チャよりスケールしやす
い
‣ デメリット
‣ サーバのスペック、台数
などスケールを意識して
設計する必要がある
‣ サーバの運⽤は利⽤者に
任されている
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スーパーマリオラン - 任天堂・DeNA様
https://aws.amazon.com/jp/solutions/case-studies/nintendo-dena/
• 150の国と地域が配信対象
• 極めて短い構築期間
• 配信開始時にアクセスが集中
しかし、障害はなし
(2017年3⽉時点で8000万DL)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2.Serverless Architecture
Amazon API Gateway
(以下API GW)
AWS Lambda
(以下Lambda)
Amazon DynamoDB
(以下DynamoDB)
Amazon Cognito
(以下Cognito)
クライアントアプリは Cognito から
Temporary Credentials を得た後、
JSON で Web API と通信
サーバサイドは
API GW/Lambda/DynamoDB
といったマネージドサービスを⽤い、
EC2 や ELB を利⽤しない
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2.Serverless Architecture
‣ メリット
‣ クライアント側の実装は従
来とあまり変わらずノウハ
ウを活かせる
‣ サーバの運⽤、スケールは
AWS に⼀任できる
‣ Cognito によるセキュアな
API アクセス制御が可能
‣ コスト効率が⾼い
‣ デメリット
‣ カスタマイズ性が低い
‣ 運⽤ノウハウが枯れていな
い
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
モンスターハンター エクスプロア - カプコン様
https://aws.amazon.com/jp/solutions/case-studies/capcom/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3.2-Tier Architecture
クライアントアプリは Cognito から
Temporary Credentials を得た後、
AWS SDK を通じて各 AWS リソー
スの API を直接叩く
サーバサイドは各 AWS リソースを
セッティングしておくのみ
(左図は⼀部の例)
Amazon
Mobile Analytics
(以下MA)
Lambda
DynamoDB
Cognito
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3.2-Tier Architecture
‣ メリット
‣ インフラの運⽤、スケール
は AWS に⼀任できる
‣ 上限値の緩和申請は除く
‣ Cognito によるセキュアな
アクセス制御が可能
‣ Web API の設計は不要
‣ コスト効率が⾼い
‣ デメリット
‣ カスタマイズ性が低い
‣ 運⽤ノウハウが枯れていな
い
‣ クライアントサイドが各
AWSリソースに依存する
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アナザーエデン - グリー様
https://aws.amazon.com/jp/solutions/case-studies/gree-ddb/
Amazon DynamoDB を利⽤したオートセーブ機能の実装により、通信待ちストレスのない
往年の JRPG を彷彿させるようなシームレスなゲーム体験を実現
• MySQL を排除し、サーバーサイドをシンプルに
• DynamoDB Streams でリアルタイムな分析も
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3.2-Tier Architecture2.Serverless Architecture
1.典型的な3層Web
アプリケーション 構造
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3.2-Tier Architecture2.Serverless Architecture
1.典型的な3層Web
アプリケーション 構造
REST REST REST
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
REST API
Data
Source
GET /search
GET /m_search
POST /taps
GET /taps
GET /taps/:id
GET /taps/:id/status
PUT /taps/:id
REST Endpoints
ü 簡単にセットアップ
ü 標準の HTTP 呼び出し
p Join
p 簡略化された「一覧情報」
p クエリサポート
p 順序付け と ページング
p 通知
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:Invent 2017
Introduced AWS AppSync
Currently Public Preview
https://pages.awscloud.com/awsappsyncpreview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Managed GraphQL Service
Alexa skill
Elasticsearch
DynamoDB
/foo
AWS AppSync
Browser
Mobile
device
Subscription
AWS Lambda
Other service
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GraphQL とは
• データ取得のために設計された宣⾔的なクエリ⾔語。
• 仕様はオープン
• グラフDBとは関係ない(例えば、Neo4j)
• NoSQL, Relational, HTTP, etc.
REST APIよくあるデータ取得 GraphQL によるデータ取得
/posts
/postInfo
/postJustTitle
/postsByAuthor
/postNameStartsWithX
/commentsOnPost
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GraphQL とは
• API ⽤のクエリ⾔語
• クライアント ー サーバ間で共有される強い型付け
• クライアントはサーバのデータを取得、更新、購読する
• クライアントはレスポンスの形式を指定。
• クライアント側の欲しいデータを欲しい形式でクエリ可能
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
API のためのクエリ⾔語
1. Queries read data
2. Mutations write data
3. Subscriptions are pushed data in real time
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GraphQL はどのように動くのか
{
"id": "1",
"name": "Get Milk",
"priority": "1"
},
{ "id": "2",
"name": "Go to gym",
"priority": "5"
},…
type Query {
getTodos: [Todo]
}
type Todo {
id: ID!
name: String
description: String
priority: Int
duedate: String
}
query {
getTodos {
id
name
priority
}
}
データのスキーマを定義 問い合わせ(クエリ) 希望したデータが返却
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync の特徴
• マネージドの GraphQL サービス とクライアント SDK
• AWS アカウント内のリソースに接続
• GraphQL の Request/Response とデータソース間の
マッピングを宣⾔的に記述
• オフラインの処理をビルトイン
• クライアント側とサーバ側の更新コンフリクトをクラウド上で解決
• シンプルかつスケーラブルな リアルタイムのデータ同期
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync はどのように動くのか
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Resolver Mapping Template
• 「GraphQL Request」を「DynamoDB の API コール」にどう変換するか
• 「DynamoDB の Response データ」を「Response Body」にどう変換するか
(※データソースが DynamoDB の場合)
これらは Mapping Template を使ってカスタマイズが可能
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Request Template
(1) GraphQL Query
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Request Template
(1) GraphQL Query
(2) Request Template
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Request Template
(1) GraphQL Query
(2) Request Template
(3) Dynamo DB API Call
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(1) DynamoDB Result Data
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(1) DynamoDB Result Data
(2) Response Template
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(1) DynamoDB Result Data
(2) Response Template
(3) Response Data
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(3) Response Data
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(3) Response Data
(4) GraphQL Response
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Response Template
(3) Response Data
(4) GraphQL Response
※ Response Template は Simple にこうも書ける
https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
料⾦
https://aws.amazon.com/jp/appsync/pricing/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
料⾦例
https://aws.amazon.com/jp/appsync/pricing/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync を使って
データ駆動のアプリケーションを構築
• 堅牢で、1⽇に何百万件ものイベントを処理できる
スケーラブルなストレージ
• 地理空間検索
• モバイルとウェブ両⽅でリアルタイムに更新
• モバイルとウェブのクライアント
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync の利点
• スケーラブルなマネージドの GraphQL Service
• 単⼀リクエストで複数データソースから複数リソースを取得
• クライアントが欲しいデータを過不⾜なく取得
→ リクエスト数の低減によるパフォーマンスの向上
• 強⼒な型システム
• GraphQL の⾃⼰記述的な API と、
AppSync の宣⾔的な リゾルバ・マッピング・テンプレート
→ API ロジックのメンテナビリティを向上
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync
Alexa skill
Elasticsearch
DynamoDB
/graphql
AWS AppSync
Browser
Mobile
device
Subscription
AWS Lambda
Other service
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3. 2-Tier Architecture2. Serverless Architecture
1. 典型的な3層Web
アプリケーション 構造
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3. 2-Tier Architecture2. Serverless Architecture
1. 典型的な3層Web
アプリケーション 構造
★ Managed
GraphQL Service
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• AWS で実現される多様な API サーバ実装⼿段
• ゲーム特性や開発チームに応じて、選択/組み合わせ
• AWS AppSync による
• マネージド GraphQL API Server & Client SDK
• リアルタイム処理/ストリーミング処理
• 宣⾔的なメンテナブル API ロジック
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

More Related Content

What's hot (20)

PDF
aws blackbelt amazon elasticsearch service
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2018 ReInvent recap security other
Amazon Web Services Japan
 
PDF
Reinvent2017 recap-gaming-session-2
Amazon Web Services Japan
 
PDF
[JAWS DAYS] 20180310 Alexa for Business とワークスタイルの未来
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
Amazon Web Services Japan
 
PDF
【IVS CTO Night & Day】Serverless & Mobile Updates
Amazon Web Services Japan
 
PDF
【IVS CTO Night & Day】アマゾンのイノベーション 〜それを支えるカルチャー〜
Amazon Web Services Japan
 
PDF
【IVS CTO Night & Day】AI / Machine Learning on AWS
Amazon Web Services Japan
 
PDF
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
Amazon Web Services Japan
 
PDF
[MANABIYA] 20180323 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
PDF
AWS re:Invent 2017 Security re:Cap Key Messages
Hayato Kiriyama
 
PDF
AWS Black Belt Online Seminar 2018 Amazon WorkSpaces
Amazon Web Services Japan
 
PDF
20180508 AWS Black Belt Online Seminar AWS Greengrassで実現するエッジコンピューティング
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
PDF
[最新版は別にございます! Descriptionをご確認ください] AWS Black Belt Online Seminar AWS re:Inven...
Amazon Web Services Japan
 
PDF
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
Amazon Web Services Japan
 
PDF
Reinvent2017 recap-gaming-session-1
Amazon Web Services Japan
 
PPTX
AWS Black Belt Online Seminar 2018 動画配信 on AWS
Amazon Web Services Japan
 
PDF
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
Amazon Web Services Japan
 
PDF
The Twelve-Factor Appで考えるAWSのサービス開発
Amazon Web Services Japan
 
aws blackbelt amazon elasticsearch service
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2018 ReInvent recap security other
Amazon Web Services Japan
 
Reinvent2017 recap-gaming-session-2
Amazon Web Services Japan
 
[JAWS DAYS] 20180310 Alexa for Business とワークスタイルの未来
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2018 re:Invent 2017 Recap Machine Learning / Da...
Amazon Web Services Japan
 
【IVS CTO Night & Day】Serverless & Mobile Updates
Amazon Web Services Japan
 
【IVS CTO Night & Day】アマゾンのイノベーション 〜それを支えるカルチャー〜
Amazon Web Services Japan
 
【IVS CTO Night & Day】AI / Machine Learning on AWS
Amazon Web Services Japan
 
【IVS CTO Night & Day】AWS re:Invent 2017 振り返り
Amazon Web Services Japan
 
[MANABIYA] 20180323 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
AWS re:Invent 2017 Security re:Cap Key Messages
Hayato Kiriyama
 
AWS Black Belt Online Seminar 2018 Amazon WorkSpaces
Amazon Web Services Japan
 
20180508 AWS Black Belt Online Seminar AWS Greengrassで実現するエッジコンピューティング
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Aurora with PostgreSQL Compatibility
Amazon Web Services Japan
 
[最新版は別にございます! Descriptionをご確認ください] AWS Black Belt Online Seminar AWS re:Inven...
Amazon Web Services Japan
 
20180221 AWS Black Belt Online Seminar AWS Lambda@Edge
Amazon Web Services Japan
 
Reinvent2017 recap-gaming-session-1
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2018 動画配信 on AWS
Amazon Web Services Japan
 
【12/5 最新版】AWS Black Belt Online Seminar AWS re:Invent 2018 アップデート情報
Amazon Web Services Japan
 
The Twelve-Factor Appで考えるAWSのサービス開発
Amazon Web Services Japan
 

Similar to Serverless backendformobilegame and_aws-appsync_gamingtechnight-2 (20)

PDF
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
Amazon Web Services Japan
 
PDF
Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Amazon Web Services Japan
 
PPTX
NoSQL on AWSで作る最新ソーシャルゲームアーキテクチャ
Yasuhiro Matsuo
 
PDF
[AWSマイスターシリーズ] AWS Client Side SDK -Android,iOS & JavaScript-
Amazon Web Services Japan
 
PDF
0730 bp study#35発表資料
Yasuhiro Horiuchi
 
PPTX
Cedec2017 Lumberyard GameLift
Amazon Web Services Japan
 
PDF
モバイル開発を支えるAWS Mobile Services
Keisuke Nishitani
 
PDF
AWS Black Belt Online Seminar 2017 AWS re:Invent 2017速報
Amazon Web Services Japan
 
PDF
AWSにおける モバイル向けサービス及び事例紹介(20151211)
Keisuke Nishitani
 
PDF
Amazon Game Tech アマゾンゲームテクノロジー - Amazon Game Tech - GTMF 2018 TOKYO
Game Tools & Middleware Forum
 
PPTX
Game Architecture Trends in Tokyo Kansai Social Game Study#5
Yasuhiro Matsuo
 
PDF
AWS SDK for Android and iOS
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
Amazon Web Services Japan
 
PDF
"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築
Junji Nishihara
 
PDF
[AWS Developers Meetup 2017] Developerのための ライブAWSウォークスルー 〜 AWS SDKの使い方 〜
Atsushi Fukui
 
PPTX
MongoDB on AWSクラウドという選択
Yasuhiro Matsuo
 
PDF
なぜソーシャルゲームはクラウドなのか? ~AWSの成功事例を紐解く~
SORACOM, INC
 
PDF
次世代ディザスタリカバリを成功させるアマゾンクラウド活用法
SORACOM, INC
 
PDF
ゲームプラットフォーム on AWS
Amazon Web Services Japan
 
PDF
AWS Black Belt Techシリーズ AWS SDK
Amazon Web Services Japan
 
AWS Black Belt Online Seminar AWS上でのスピードと高可用性を両立したゲームインフラの構築と事例
Amazon Web Services Japan
 
Gaming on aws 〜ゲームにおけるAWS最新活用術〜
Amazon Web Services Japan
 
NoSQL on AWSで作る最新ソーシャルゲームアーキテクチャ
Yasuhiro Matsuo
 
[AWSマイスターシリーズ] AWS Client Side SDK -Android,iOS & JavaScript-
Amazon Web Services Japan
 
0730 bp study#35発表資料
Yasuhiro Horiuchi
 
Cedec2017 Lumberyard GameLift
Amazon Web Services Japan
 
モバイル開発を支えるAWS Mobile Services
Keisuke Nishitani
 
AWS Black Belt Online Seminar 2017 AWS re:Invent 2017速報
Amazon Web Services Japan
 
AWSにおける モバイル向けサービス及び事例紹介(20151211)
Keisuke Nishitani
 
Amazon Game Tech アマゾンゲームテクノロジー - Amazon Game Tech - GTMF 2018 TOKYO
Game Tools & Middleware Forum
 
Game Architecture Trends in Tokyo Kansai Social Game Study#5
Yasuhiro Matsuo
 
AWS SDK for Android and iOS
Amazon Web Services Japan
 
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
Amazon Web Services Japan
 
"Kong Summit, Japan 2022" パートナーセッション:Kong on AWS で実現するスケーラブルな API 基盤の構築
Junji Nishihara
 
[AWS Developers Meetup 2017] Developerのための ライブAWSウォークスルー 〜 AWS SDKの使い方 〜
Atsushi Fukui
 
MongoDB on AWSクラウドという選択
Yasuhiro Matsuo
 
なぜソーシャルゲームはクラウドなのか? ~AWSの成功事例を紐解く~
SORACOM, INC
 
次世代ディザスタリカバリを成功させるアマゾンクラウド活用法
SORACOM, INC
 
ゲームプラットフォーム on AWS
Amazon Web Services Japan
 
AWS Black Belt Techシリーズ AWS SDK
Amazon Web Services Japan
 
Ad

More from Amazon Web Services Japan (20)

PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
PDF
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
PDF
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
PPTX
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
PDF
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
PDF
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
PDF
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
PDF
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
PPTX
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
PDF
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 
Ad

Recently uploaded (9)

PDF
人気ブロックチェーン基盤「Hyperledger Fabric」最新版を動かしてみた!
LFDT Tokyo Meetup
 
PDF
20250710_Devinで切り拓くDB革命_〜価値創出に集中せよ〜.pdf
Masaki Yamakawa
 
PDF
SIG-AUDIO 2025 Vol.02 オンラインセミナー SIG-Audioプレゼン資料_オーディオプラグイン開発_塩澤達矢.pdf
IGDA Japan SIG-Audio
 
PDF
ABC2025S LT講演「世界の窓から Androidこんにちは2025」アプリ自動生成の将来?ロボティクスの夢再び?
嶋 是一 (Yoshikazu SHIMA)
 
PDF
2023年版Web3技術の理想と現実
Syuhei Hiya
 
PDF
Hyperledger Fabric公式サンプル fabric-samples徹底解説
LFDT Tokyo Meetup
 
PDF
Hyperledger Fabric最新v3.x系での機能強化、変更点にキャッチアップ!
LFDT Tokyo Meetup
 
PDF
20250630_aws_reinforce_2025_aws_sheild_network_security_director
uedayuki
 
PDF
生成AIパネルトーク(Interop25Tokyo APPS JAPAN M1-07,M2-07 嶋ポジショントーク)
嶋 是一 (Yoshikazu SHIMA)
 
人気ブロックチェーン基盤「Hyperledger Fabric」最新版を動かしてみた!
LFDT Tokyo Meetup
 
20250710_Devinで切り拓くDB革命_〜価値創出に集中せよ〜.pdf
Masaki Yamakawa
 
SIG-AUDIO 2025 Vol.02 オンラインセミナー SIG-Audioプレゼン資料_オーディオプラグイン開発_塩澤達矢.pdf
IGDA Japan SIG-Audio
 
ABC2025S LT講演「世界の窓から Androidこんにちは2025」アプリ自動生成の将来?ロボティクスの夢再び?
嶋 是一 (Yoshikazu SHIMA)
 
2023年版Web3技術の理想と現実
Syuhei Hiya
 
Hyperledger Fabric公式サンプル fabric-samples徹底解説
LFDT Tokyo Meetup
 
Hyperledger Fabric最新v3.x系での機能強化、変更点にキャッチアップ!
LFDT Tokyo Meetup
 
20250630_aws_reinforce_2025_aws_sheild_network_security_director
uedayuki
 
生成AIパネルトーク(Interop25Tokyo APPS JAPAN M1-07,M2-07 嶋ポジショントーク)
嶋 是一 (Yoshikazu SHIMA)
 

Serverless backendformobilegame and_aws-appsync_gamingtechnight-2

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Web Services Japan K.K. Solutions Architect Fumihiko Hata 2017.01.24 AWS におけるモバイルゲーム向け API サーバの実装 2018 AWS Gaming Tech Night #2
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 内容についての注意点 本資料では2017年1⽉24⽇時点のサービス内容および価格についてご説明しています。最新 の情報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。 • 資料作成には⼗分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格 に相違があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。 • 価格は税抜表記となっています。⽇本居住者のお客様が東京リージョンを使⽤する場合、 別途消費税をご請求させていただきます。 AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda モバイルゲームのアーキテクチャと構成要素 API サーバ 実装/アーキテクチャ Amazon EC2 & ELB (Typical 3-Tier) Amazon API Gateway & AWS Lambda (Serverless 3-Tier) Amazon Cognito (Serverless 2-Tier) AWS AppSync (Managed GraphQL) まとめ
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint ① HTTP API を⽤いてログイン
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint ② Game Assets をダウンロード
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint ③ Game Serverのマッチメイク
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint ④ GameServer へ接続してバトル
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アーキテクチャ例 S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint ⑤ HTTP API を⽤いて結果を永続化
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. S3CloudFront WAF Shield ELB ElastiCache DynamoDB RDSEC2 Game Servers EC2 API Servers Kinesis S3 Redshift Athena QuickSight CognitoRoute53 分析 配信 ネットワーク セキュリティ API ゲーム 共通基盤 Client RDS プッシュ通知 Pinpoint API サーバ
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. モバイルゲームの API サーバ • ゲーム内の様々なユーザ操作を 処理、保存する • ログイン、アイテム購⼊、デッキ編 成、バトルのマッチング、etc. • 処理結果は RDB に永続されること が多い • バトルやステージ内での⼀連のゲー ムプレイ処理は 専⽤のゲームサー バが受け持つことが多い • HTTP(S) で RESTful など • 全ユーザで同⼀のエンドポイント ELB ElastiCache DynamoDB EC2 API Servers API RDS
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. モバイルゲームの API サーバに求められるもの 1. 可⽤性 • 落ちるとゲームが進⾏不可に 2. スケーラビリティ • 全ユーザが単⼀のエンドポイント 3. レスポンス速度 • ゲーム体験に直接的に影響 4. コードのメンテナビリティ • ⽇々、機能追加・機能修正 • 繰り返されるイベント実装 ELB ElastiCache DynamoDB EC2 API Servers API RDS
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 実装/アーキテクチャ
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 1.典型的な3層Webアプリケーション クライアントは HTTP(S) で Web サーバ と通信 サーバサイドは ELB + EC2 + RDS Elastic Load Balancing (以下ELB) Amazon Elastic Compute Cloud (以下EC2) Amazon Relational Database Service (以下RDS)
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 1.典型的な3層Webアプリケーション ‣ メリット ‣ 実績が多く枯れた構成 ‣ カスタマイズ性が⾼い ‣ 場合によっては後述の サーバレスアーキテク チャよりスケールしやす い ‣ デメリット ‣ サーバのスペック、台数 などスケールを意識して 設計する必要がある ‣ サーバの運⽤は利⽤者に 任されている
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. スーパーマリオラン - 任天堂・DeNA様 https://aws.amazon.com/jp/solutions/case-studies/nintendo-dena/ • 150の国と地域が配信対象 • 極めて短い構築期間 • 配信開始時にアクセスが集中 しかし、障害はなし (2017年3⽉時点で8000万DL)
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2.Serverless Architecture Amazon API Gateway (以下API GW) AWS Lambda (以下Lambda) Amazon DynamoDB (以下DynamoDB) Amazon Cognito (以下Cognito) クライアントアプリは Cognito から Temporary Credentials を得た後、 JSON で Web API と通信 サーバサイドは API GW/Lambda/DynamoDB といったマネージドサービスを⽤い、 EC2 や ELB を利⽤しない
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2.Serverless Architecture ‣ メリット ‣ クライアント側の実装は従 来とあまり変わらずノウハ ウを活かせる ‣ サーバの運⽤、スケールは AWS に⼀任できる ‣ Cognito によるセキュアな API アクセス制御が可能 ‣ コスト効率が⾼い ‣ デメリット ‣ カスタマイズ性が低い ‣ 運⽤ノウハウが枯れていな い
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. モンスターハンター エクスプロア - カプコン様 https://aws.amazon.com/jp/solutions/case-studies/capcom/
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3.2-Tier Architecture クライアントアプリは Cognito から Temporary Credentials を得た後、 AWS SDK を通じて各 AWS リソー スの API を直接叩く サーバサイドは各 AWS リソースを セッティングしておくのみ (左図は⼀部の例) Amazon Mobile Analytics (以下MA) Lambda DynamoDB Cognito
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3.2-Tier Architecture ‣ メリット ‣ インフラの運⽤、スケール は AWS に⼀任できる ‣ 上限値の緩和申請は除く ‣ Cognito によるセキュアな アクセス制御が可能 ‣ Web API の設計は不要 ‣ コスト効率が⾼い ‣ デメリット ‣ カスタマイズ性が低い ‣ 運⽤ノウハウが枯れていな い ‣ クライアントサイドが各 AWSリソースに依存する
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アナザーエデン - グリー様 https://aws.amazon.com/jp/solutions/case-studies/gree-ddb/ Amazon DynamoDB を利⽤したオートセーブ機能の実装により、通信待ちストレスのない 往年の JRPG を彷彿させるようなシームレスなゲーム体験を実現 • MySQL を排除し、サーバーサイドをシンプルに • DynamoDB Streams でリアルタイムな分析も
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3.2-Tier Architecture2.Serverless Architecture 1.典型的な3層Web アプリケーション 構造
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3.2-Tier Architecture2.Serverless Architecture 1.典型的な3層Web アプリケーション 構造 REST REST REST
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. REST API Data Source GET /search GET /m_search POST /taps GET /taps GET /taps/:id GET /taps/:id/status PUT /taps/:id REST Endpoints ü 簡単にセットアップ ü 標準の HTTP 呼び出し p Join p 簡略化された「一覧情報」 p クエリサポート p 順序付け と ページング p 通知
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:Invent 2017 Introduced AWS AppSync Currently Public Preview https://pages.awscloud.com/awsappsyncpreview.html
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Managed GraphQL Service Alexa skill Elasticsearch DynamoDB /foo AWS AppSync Browser Mobile device Subscription AWS Lambda Other service
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. GraphQL とは • データ取得のために設計された宣⾔的なクエリ⾔語。 • 仕様はオープン • グラフDBとは関係ない(例えば、Neo4j) • NoSQL, Relational, HTTP, etc. REST APIよくあるデータ取得 GraphQL によるデータ取得 /posts /postInfo /postJustTitle /postsByAuthor /postNameStartsWithX /commentsOnPost
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. GraphQL とは • API ⽤のクエリ⾔語 • クライアント ー サーバ間で共有される強い型付け • クライアントはサーバのデータを取得、更新、購読する • クライアントはレスポンスの形式を指定。 • クライアント側の欲しいデータを欲しい形式でクエリ可能
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. API のためのクエリ⾔語 1. Queries read data 2. Mutations write data 3. Subscriptions are pushed data in real time
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. GraphQL はどのように動くのか { "id": "1", "name": "Get Milk", "priority": "1" }, { "id": "2", "name": "Go to gym", "priority": "5" },… type Query { getTodos: [Todo] } type Todo { id: ID! name: String description: String priority: Int duedate: String } query { getTodos { id name priority } } データのスキーマを定義 問い合わせ(クエリ) 希望したデータが返却
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync の特徴 • マネージドの GraphQL サービス とクライアント SDK • AWS アカウント内のリソースに接続 • GraphQL の Request/Response とデータソース間の マッピングを宣⾔的に記述 • オフラインの処理をビルトイン • クライアント側とサーバ側の更新コンフリクトをクラウド上で解決 • シンプルかつスケーラブルな リアルタイムのデータ同期
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync はどのように動くのか
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Resolver Mapping Template • 「GraphQL Request」を「DynamoDB の API コール」にどう変換するか • 「DynamoDB の Response データ」を「Response Body」にどう変換するか (※データソースが DynamoDB の場合) これらは Mapping Template を使ってカスタマイズが可能 https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Request Template (1) GraphQL Query https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Request Template (1) GraphQL Query (2) Request Template https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Request Template (1) GraphQL Query (2) Request Template (3) Dynamo DB API Call https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (1) DynamoDB Result Data https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (1) DynamoDB Result Data (2) Response Template https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (1) DynamoDB Result Data (2) Response Template (3) Response Data https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (3) Response Data https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (3) Response Data (4) GraphQL Response https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Response Template (3) Response Data (4) GraphQL Response ※ Response Template は Simple にこうも書ける https://docs.aws.amazon.com/ja_jp/appsync/latest/devguide/resolver-mapping-template-reference-overview.html
  • 44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 料⾦ https://aws.amazon.com/jp/appsync/pricing/
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 料⾦例 https://aws.amazon.com/jp/appsync/pricing/
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync を使って データ駆動のアプリケーションを構築 • 堅牢で、1⽇に何百万件ものイベントを処理できる スケーラブルなストレージ • 地理空間検索 • モバイルとウェブ両⽅でリアルタイムに更新 • モバイルとウェブのクライアント
  • 47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync の利点 • スケーラブルなマネージドの GraphQL Service • 単⼀リクエストで複数データソースから複数リソースを取得 • クライアントが欲しいデータを過不⾜なく取得 → リクエスト数の低減によるパフォーマンスの向上 • 強⼒な型システム • GraphQL の⾃⼰記述的な API と、 AppSync の宣⾔的な リゾルバ・マッピング・テンプレート → API ロジックのメンテナビリティを向上
  • 48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync Alexa skill Elasticsearch DynamoDB /graphql AWS AppSync Browser Mobile device Subscription AWS Lambda Other service
  • 49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3. 2-Tier Architecture2. Serverless Architecture 1. 典型的な3層Web アプリケーション 構造
  • 50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3. 2-Tier Architecture2. Serverless Architecture 1. 典型的な3層Web アプリケーション 構造 ★ Managed GraphQL Service
  • 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. まとめ • AWS で実現される多様な API サーバ実装⼿段 • ゲーム特性や開発チームに応じて、選択/組み合わせ • AWS AppSync による • マネージド GraphQL API Server & Client SDK • リアルタイム処理/ストリーミング処理 • 宣⾔的なメンテナブル API ロジック
  • 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.