SlideShare uma empresa Scribd logo
1 de 61
Baixar para ler offline
최명근 - mgchoi@google.com
Cloud Sales Engineer
Google Cloud Platform Workshop
01 Google Cloud Platform
3
BigQuery
Big Data
Pub/Sub Dataflow Dataproc Datalab
Compute
Compute
Engine
App Engine Container
Engine
App Services
Cloud EndpointsPrediction API Translate API
Storage
Cloud
Storage
Cloud SQL Cloud
Datastore
Bigtable
Google Cloud Platform
Building what’s next 4
70 edge locations
33 countries
The broadest reaching network
of any Cloud Provider
Google-Grade Networking
Live Migration = No Downtime
GCE Custom Machine Types
Average Savings: 19%
Unique GCE Capabilities
Industry-leading IO performance
Per-minute billing & Sustained Use Discounts
Super-fast startup times: 1000 VMs in < 5 minutes
High throughput to storage at no extra cost
NEW: Resize disks with no downtime
Multi-Cloud Reality
Public Cloud Private Cloud Open Source
& APIs
Multi-cloud monitoring & logging
Tracing, Error Reporting, Debugging
Intelligent defaults
Apps
Kubernetes
Builds on our 10 years of container management
Designed for multi-cloud
Broad industry support
02 Mobile Game Pattern on GCP
12
Typical requirements for a compelling mobile game include:
1. Game features :
● Dynamic game content
● Game data stored outside of devices
● Leaderboard
● Multiplayer mode
● Player matching
● Board generation
● Server site bots
2. Platform features :
● Support for Android and iOS devices through native client applications
● Push notifications to Android and IOS devices
● User authentication
● High scalability
3. Business features :
● In-game purchases
● Game analytics
13
Many popular mobile games use mobile backends to:
● Deliver dynamic game content
● Facilitate multiplayer games, including matching players
● Store data outside of the mobile device, e.g., the last completed level, or the scores
achieved in the previous plays
● Manage the leaderboard
● Orchestrate push notifications
● Facilitate in-game purchases
● Provide game analytics
14
Your Mobile Game Backend in the Cloud
● Automatic scalability
● Automatic load balancing across instances of your mobile backend
● Static content serving and caching
● Reliability, performance, and security features
● Monitoring and management
● Configurable DoS protection
● Integration with Google Accounts for OAuth2 authentication (for both Android
and iOS clients)
15
Easy scalability
Task queue
Background
Image processingMedia serving
API endpoints
Push to phone
Game logic
Datastore
Memcache
Mobile Backend
running on Google
App Engine Instances
iOS
CloudEndPointClients
Cloud Endpoints
● Create APIs for Mobile Apps to
communicate with Mobile Backends
● Add annotations to client interface
application code or generate Endpoint
classes from Models.
● Discoverable, Restful APIs
implemented on top of Google’s API
Infrastructure
● Tools available for generating Client
Libraries for Android, iOS and
JavaScript
● Built-In Authentication Support
APIs for Mobile Backends Made Easy
Storage Services
Web APIs
Cloud
Endpoints
Java - App Engine
@ApiMethod(httpMethod = "PUT", path = "game/{id}/answers")
public void submitAnswers(
@Named("id") long gameId, GamePlayStatus answers,
User player)
throws UnauthorizedException, NotFoundException {
if (user == null) {
throw new UnauthorizedException("The user is not authorized.");
gameService.submitAnswers(gameId, player, answers);
}
Java - Android Apppublic class SubmitAnswersTask extends ServiceTask<Void> {
protected void executeEndpointCall() {
service.gameEndpoint().submitAnswers(gameId, answers).execute();
}
Cloud Endpoints - Custom API
Submit Answers
Cloud Endpoints - Custom API
Java - App Engine
Mobile Game-AppEngine $ endpoints.sh get-client-lib org.arw.examples.appengine.mobilegame.GameInviteEndpoint
Jul 17, 2013 3:05:32 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed ./war/WEB-INF/appengine-web.xml
API configuration written to ./gameinviteendpoint-v1.api
API Discovery Document written to ./gameinviteendpoint-v1-rpc.discovery
API Discovery Document written to ./gameinviteendpoint-v1-rest.discovery
API client library written to ./gameinviteendpoint-v1-java.zip
Eclipse
Cloud Endpoints Development
Generate Client Library
Cloud Endpoints Development
19
A Globally Distributed Player Base
US users
EU users
Australia users
Communication
MySQL
Redis
API
US
EU
AUS
Websocket
Geo
Load Balancer
20
Matchmaking
MySQL
Game servers
Matchmaker
module
Find server
Register server
I want to play
Assign players
21
Profile and Session Management
MySQL
Signed URL
Profile pictures
Bucket
Edge
Cache
Public pictures
Bucket
Session
information
Redis
User registration
and login
User frontend
PD
SSD
Image metadata
22
Smart client Smart backend
Push to Phone
Web sockets
In-game real time
notifications Push notifications
OR
23
03 How to build mobile games using
App Engine and Cloud Endpoints ?
25
Griddler - multiplayer riddle mobile game
26
27
Responsibilities of the mobile game backend include :
● Serving board definitions to the clients
● Managing the list of players and their statistics (for example, how many games a player
played across different devices, how many multiplayer games she won)
● Managing the list of devices used by players in order to be able to send push notifications
to these devices
● Sending game invitations for multiplayer games
● Relaying invitation acceptance, declines and cancellations
28
Key components of mobile gaming solutions
● The mobile game client applications
● The mobile game backend
○ Griddler API includes methods for:
■ Game Management, for example startNewSinglePlayerGame and gameFinished
■ Player Invitations, for example sendInvitation, acceptInvitation etc.
■ Notifications, for example registerDeviceForPushNotification
29
Communication between clients apps and your mobile game backend
@Api annotation
API call from the client
30
Storing data
31
Optimizing data access with Memcache
A backend running on Google App Engine can
use a distributed in-memory, data cache service
called Memcache to store and retrieve
frequently accessed data
32
● Make a game more engaging and social
● Task Queues
○ Push Queue : Sending the enqueued tasks (push model) to your code running on
Google App Engine as HTTP requests to a chosen URL
○ Pull Queue : Mobile backend code can pull the tasks from the queue / Process the
tasks outside of App Engine
Asynchronous processing with Task Queues
33
Push notifications
34
Serving and processing images
35
Scheduled jobs
36
37
Firebase is a powerful platform for
mobile and web applications.
Static HostingRealtime Database User Authentication
Web Framework Integrations
Server Side Access
Client SDKs
Realtime Database
NoSQL JSON database
Three Tier Architecture
device application
server
database
Two Tier Architecture
Firebasedevice
● Fast Development
● Offload Scaling
● Unified Security
Two Tier Architecture
Firebasedevice
server
api
Database
Realtime Data Synchronization
// Create a Firebase database reference
var ref = new Firebase("https://googleformobile.firebaseio.com");
// Write data from Firebase
ref.set("Hi GCP WorkShop!");
// Read data from Firebase
ref.on("value", function(snapshot) {
var data = snapshot.val();
console.log(snapshot.val());
});
"rules": {
"foo": {
// /foo/ is readable by the world
".read": true,
// /foo/ is writable by the world
".write": true,
// data written to /foo/ must be a string less than 100 characters
".validate": "newData.isString() && newData.val().length < 100"
}
}
Database: Offline Native
Database: Offline Native
Database: Offline Native
Authentication
Authentication
Email & Password
Third Party Providers
(Google, Facebook, Twitter, GitHub)
// Facebook Authentication
var ref = new Firebase("https://googleformobile.firebaseio.com");
ref.authWithOAuthPopup("facebook”, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload: ", authData);
}
});
"users": {
"$uid": {
// /users/$uid is globally readable
".read": "true",
// but only personally writable
".write": "auth.uid == $uid"
}
}
Hosting
Hosting
SSL by default
Backed by a global CDN
Custom domain support
> firebase init
Initializing app…
Successfully initialized
> firebase deploy
Progress: 100%
Successfully deployed
Let’s write some code!
58
Firebase and Google App Engine
59
Firebase and Managed VMs
60
Resources
Firebase docs: firebase.com/docs
Cloud docs : cloud.google.com/docs
Join the discussion
bit.ly/gcp-slack bit.ly/gcp-githubbit.ly/gcp-twitter gcpug.kr
Thank You

Mais conteúdo relacionado

Mais procurados

Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
Kunal Hire
 
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
Simplilearn
 

Mais procurados (20)

From Monolith to Microservices
From Monolith to MicroservicesFrom Monolith to Microservices
From Monolith to Microservices
 
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
Exposing and Controlling Kafka Event Streaming with Kong Konnect Enterprise |...
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
Driving Digital Transformation With Containers And Kubernetes Complete Deck
Driving Digital Transformation With Containers And Kubernetes Complete DeckDriving Digital Transformation With Containers And Kubernetes Complete Deck
Driving Digital Transformation With Containers And Kubernetes Complete Deck
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing
 
Introduction to appDynamics
Introduction to appDynamics Introduction to appDynamics
Introduction to appDynamics
 
User Stories explained
User Stories explainedUser Stories explained
User Stories explained
 
카카오뱅크 모바일앱 개발 이야기
카카오뱅크 모바일앱 개발 이야기카카오뱅크 모바일앱 개발 이야기
카카오뱅크 모바일앱 개발 이야기
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito Pact
 
Highlights of WSO2 API Manager 4.0.0
Highlights of WSO2 API Manager 4.0.0Highlights of WSO2 API Manager 4.0.0
Highlights of WSO2 API Manager 4.0.0
 
[열린기술공방] Container기반의 DevOps - 클라우드 네이티브
[열린기술공방] Container기반의 DevOps - 클라우드 네이티브[열린기술공방] Container기반의 DevOps - 클라우드 네이티브
[열린기술공방] Container기반의 DevOps - 클라우드 네이티브
 
2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료2022년 07월 21일 Confluent+Imply 웨비나 발표자료
2022년 07월 21일 Confluent+Imply 웨비나 발표자료
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SRE
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
Cloud Native Journey in Synchrony Financial
Cloud Native Journey in Synchrony FinancialCloud Native Journey in Synchrony Financial
Cloud Native Journey in Synchrony Financial
 
클라우드 네이티브 전환 요소 및 성공적인 쿠버네티스 도입 전략
클라우드 네이티브 전환 요소 및 성공적인 쿠버네티스 도입 전략클라우드 네이티브 전환 요소 및 성공적인 쿠버네티스 도입 전략
클라우드 네이티브 전환 요소 및 성공적인 쿠버네티스 도입 전략
 
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
Virtualization Explained | What Is Virtualization Technology? | Virtualizatio...
 

Destaque

[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
GAMENEXT Works
 
Presentation jwh pdf
Presentation jwh pdfPresentation jwh pdf
Presentation jwh pdf
Yeaji Shin
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
ogdc
 
Jeux et géolocalisation- Playground - Marseille 2.0
Jeux et géolocalisation- Playground - Marseille 2.0Jeux et géolocalisation- Playground - Marseille 2.0
Jeux et géolocalisation- Playground - Marseille 2.0
marseille20
 
홈페이지혁신소개자료(20120611)
홈페이지혁신소개자료(20120611)홈페이지혁신소개자료(20120611)
홈페이지혁신소개자료(20120611)
마경근 마
 
Google Cloud Endpoints の紹介
Google Cloud Endpoints の紹介Google Cloud Endpoints の紹介
Google Cloud Endpoints の紹介
Taiji Miyamoto
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014
James Chittenden
 

Destaque (20)

[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
[크레이지피쉬] VIVAGAME 모바일 소셜게임 플랫폼
 
Presentation jwh pdf
Presentation jwh pdfPresentation jwh pdf
Presentation jwh pdf
 
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.KeroOGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
OGDC 2014_Cross platform mobile game application development_Mr. Makku J.Kero
 
Jeux et géolocalisation- Playground - Marseille 2.0
Jeux et géolocalisation- Playground - Marseille 2.0Jeux et géolocalisation- Playground - Marseille 2.0
Jeux et géolocalisation- Playground - Marseille 2.0
 
2013 Fighting Game Artificial Intelligence Competition
2013 Fighting Game Artificial Intelligence Competition2013 Fighting Game Artificial Intelligence Competition
2013 Fighting Game Artificial Intelligence Competition
 
001. 싸이월드 앱스토어 현황 sk컴즈 김영을 부장
001. 싸이월드 앱스토어 현황 sk컴즈 김영을 부장001. 싸이월드 앱스토어 현황 sk컴즈 김영을 부장
001. 싸이월드 앱스토어 현황 sk컴즈 김영을 부장
 
Waldo-gcp
Waldo-gcpWaldo-gcp
Waldo-gcp
 
겜튜브 소개 및 튜브애드 광고상품 소개(Special Pack.)
겜튜브 소개 및 튜브애드 광고상품 소개(Special Pack.)겜튜브 소개 및 튜브애드 광고상품 소개(Special Pack.)
겜튜브 소개 및 튜브애드 광고상품 소개(Special Pack.)
 
Open Data Board Game (Datopolis) - getting started
Open Data Board Game (Datopolis) - getting startedOpen Data Board Game (Datopolis) - getting started
Open Data Board Game (Datopolis) - getting started
 
How to Grow the Customer Lifetime Value for your App?
How to Grow the Customer Lifetime Value for your App?How to Grow the Customer Lifetime Value for your App?
How to Grow the Customer Lifetime Value for your App?
 
Web Game Development
Web Game DevelopmentWeb Game Development
Web Game Development
 
홈페이지혁신소개자료(20120611)
홈페이지혁신소개자료(20120611)홈페이지혁신소개자료(20120611)
홈페이지혁신소개자료(20120611)
 
WSO2 Message Broker - Product Overview
WSO2 Message Broker - Product OverviewWSO2 Message Broker - Product Overview
WSO2 Message Broker - Product Overview
 
Lime - Push notifications. The big way.
Lime - Push notifications. The big way.Lime - Push notifications. The big way.
Lime - Push notifications. The big way.
 
오픈 소스를 활용한 게임 배치 플랫폼 개선 사례
오픈 소스를 활용한 게임 배치 플랫폼 개선 사례오픈 소스를 활용한 게임 배치 플랫폼 개선 사례
오픈 소스를 활용한 게임 배치 플랫폼 개선 사례
 
All that you must know about personalized push notifications vizury
All that you must know about personalized push notifications vizuryAll that you must know about personalized push notifications vizury
All that you must know about personalized push notifications vizury
 
Pub/Sub Messaging
Pub/Sub MessagingPub/Sub Messaging
Pub/Sub Messaging
 
From stream to recommendation using apache beam with cloud pubsub and cloud d...
From stream to recommendation using apache beam with cloud pubsub and cloud d...From stream to recommendation using apache beam with cloud pubsub and cloud d...
From stream to recommendation using apache beam with cloud pubsub and cloud d...
 
Google Cloud Endpoints の紹介
Google Cloud Endpoints の紹介Google Cloud Endpoints の紹介
Google Cloud Endpoints の紹介
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014
 

Semelhante a Mobile game architecture on GCP

201507_NeoHsu_Portfolio
201507_NeoHsu_Portfolio201507_NeoHsu_Portfolio
201507_NeoHsu_Portfolio
Neo Hsu
 

Semelhante a Mobile game architecture on GCP (20)

300 - Multiplatform Apps on Google Cloud Platform
300 - Multiplatform Apps on Google Cloud Platform300 - Multiplatform Apps on Google Cloud Platform
300 - Multiplatform Apps on Google Cloud Platform
 
A164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdkA164 enterprise javascript ibm node sdk
A164 enterprise javascript ibm node sdk
 
201507_NeoHsu_Portfolio
201507_NeoHsu_Portfolio201507_NeoHsu_Portfolio
201507_NeoHsu_Portfolio
 
JUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGearJUDCon 2014: Gearing up for mobile development with AeroGear
JUDCon 2014: Gearing up for mobile development with AeroGear
 
Romuald Zdebskiy (Microsoft) & Andrey Ivashentsev (Game Insight)
Romuald Zdebskiy (Microsoft) & Andrey Ivashentsev (Game Insight)Romuald Zdebskiy (Microsoft) & Andrey Ivashentsev (Game Insight)
Romuald Zdebskiy (Microsoft) & Andrey Ivashentsev (Game Insight)
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
GDG DevFest Romania - Architecting for the Google Cloud Platform
GDG DevFest Romania - Architecting for the Google Cloud PlatformGDG DevFest Romania - Architecting for the Google Cloud Platform
GDG DevFest Romania - Architecting for the Google Cloud Platform
 
Cloud for Game Developers – Myth or Real Scenarios?
Cloud for Game Developers – Myth or Real Scenarios?Cloud for Game Developers – Myth or Real Scenarios?
Cloud for Game Developers – Myth or Real Scenarios?
 
Ibm xamarin gtruty
Ibm xamarin gtrutyIbm xamarin gtruty
Ibm xamarin gtruty
 
Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)Google Cloud - Scale With A Smile (Dec 2014)
Google Cloud - Scale With A Smile (Dec 2014)
 
Cloud Native 오픈소스 서비스 소개 및 Serverless로 실제 게임 개발하기
Cloud Native 오픈소스 서비스 소개 및 Serverless로 실제 게임 개발하기Cloud Native 오픈소스 서비스 소개 및 Serverless로 실제 게임 개발하기
Cloud Native 오픈소스 서비스 소개 및 Serverless로 실제 게임 개발하기
 
Google Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCUGoogle Cloud Study Jam | GDSC NCU
Google Cloud Study Jam | GDSC NCU
 
Pragatheswarakumar_v1.0
Pragatheswarakumar_v1.0Pragatheswarakumar_v1.0
Pragatheswarakumar_v1.0
 
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
Build 2017 - P4062 - Delivering world-class game experiences using Microsoft ...
Build 2017 - P4062 - Delivering world-class game experiences using Microsoft ...Build 2017 - P4062 - Delivering world-class game experiences using Microsoft ...
Build 2017 - P4062 - Delivering world-class game experiences using Microsoft ...
 
GDG Heraklion - Architecting for the Google Cloud Platform
GDG Heraklion - Architecting for the Google Cloud PlatformGDG Heraklion - Architecting for the Google Cloud Platform
GDG Heraklion - Architecting for the Google Cloud Platform
 
Azure app service to create web and mobile apps
Azure app service to create web and mobile appsAzure app service to create web and mobile apps
Azure app service to create web and mobile apps
 
What’s New in WSO2 IoT Server 3.1.0
What’s New in WSO2 IoT Server 3.1.0What’s New in WSO2 IoT Server 3.1.0
What’s New in WSO2 IoT Server 3.1.0
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Powering your Apps via Google Cloud Platform
Powering your Apps via Google Cloud PlatformPowering your Apps via Google Cloud Platform
Powering your Apps via Google Cloud Platform
 

Último

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Último (6)

Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312Mobile App Penetration Testing Bsides312
Mobile App Penetration Testing Bsides312
 

Mobile game architecture on GCP

  • 1. 최명근 - mgchoi@google.com Cloud Sales Engineer Google Cloud Platform Workshop
  • 2. 01 Google Cloud Platform
  • 3. 3 BigQuery Big Data Pub/Sub Dataflow Dataproc Datalab Compute Compute Engine App Engine Container Engine App Services Cloud EndpointsPrediction API Translate API Storage Cloud Storage Cloud SQL Cloud Datastore Bigtable Google Cloud Platform
  • 4. Building what’s next 4 70 edge locations 33 countries The broadest reaching network of any Cloud Provider Google-Grade Networking
  • 5. Live Migration = No Downtime
  • 6. GCE Custom Machine Types Average Savings: 19%
  • 7. Unique GCE Capabilities Industry-leading IO performance Per-minute billing & Sustained Use Discounts Super-fast startup times: 1000 VMs in < 5 minutes High throughput to storage at no extra cost NEW: Resize disks with no downtime
  • 8. Multi-Cloud Reality Public Cloud Private Cloud Open Source & APIs
  • 9. Multi-cloud monitoring & logging Tracing, Error Reporting, Debugging Intelligent defaults
  • 10. Apps Kubernetes Builds on our 10 years of container management Designed for multi-cloud Broad industry support
  • 11. 02 Mobile Game Pattern on GCP
  • 12. 12 Typical requirements for a compelling mobile game include: 1. Game features : ● Dynamic game content ● Game data stored outside of devices ● Leaderboard ● Multiplayer mode ● Player matching ● Board generation ● Server site bots 2. Platform features : ● Support for Android and iOS devices through native client applications ● Push notifications to Android and IOS devices ● User authentication ● High scalability 3. Business features : ● In-game purchases ● Game analytics
  • 13. 13 Many popular mobile games use mobile backends to: ● Deliver dynamic game content ● Facilitate multiplayer games, including matching players ● Store data outside of the mobile device, e.g., the last completed level, or the scores achieved in the previous plays ● Manage the leaderboard ● Orchestrate push notifications ● Facilitate in-game purchases ● Provide game analytics
  • 14. 14 Your Mobile Game Backend in the Cloud ● Automatic scalability ● Automatic load balancing across instances of your mobile backend ● Static content serving and caching ● Reliability, performance, and security features ● Monitoring and management ● Configurable DoS protection ● Integration with Google Accounts for OAuth2 authentication (for both Android and iOS clients)
  • 15. 15 Easy scalability Task queue Background Image processingMedia serving API endpoints Push to phone Game logic Datastore Memcache
  • 16. Mobile Backend running on Google App Engine Instances iOS CloudEndPointClients Cloud Endpoints ● Create APIs for Mobile Apps to communicate with Mobile Backends ● Add annotations to client interface application code or generate Endpoint classes from Models. ● Discoverable, Restful APIs implemented on top of Google’s API Infrastructure ● Tools available for generating Client Libraries for Android, iOS and JavaScript ● Built-In Authentication Support APIs for Mobile Backends Made Easy Storage Services Web APIs Cloud Endpoints
  • 17. Java - App Engine @ApiMethod(httpMethod = "PUT", path = "game/{id}/answers") public void submitAnswers( @Named("id") long gameId, GamePlayStatus answers, User player) throws UnauthorizedException, NotFoundException { if (user == null) { throw new UnauthorizedException("The user is not authorized."); gameService.submitAnswers(gameId, player, answers); } Java - Android Apppublic class SubmitAnswersTask extends ServiceTask<Void> { protected void executeEndpointCall() { service.gameEndpoint().submitAnswers(gameId, answers).execute(); } Cloud Endpoints - Custom API Submit Answers Cloud Endpoints - Custom API
  • 18. Java - App Engine Mobile Game-AppEngine $ endpoints.sh get-client-lib org.arw.examples.appengine.mobilegame.GameInviteEndpoint Jul 17, 2013 3:05:32 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml INFO: Successfully processed ./war/WEB-INF/appengine-web.xml API configuration written to ./gameinviteendpoint-v1.api API Discovery Document written to ./gameinviteendpoint-v1-rpc.discovery API Discovery Document written to ./gameinviteendpoint-v1-rest.discovery API client library written to ./gameinviteendpoint-v1-java.zip Eclipse Cloud Endpoints Development Generate Client Library Cloud Endpoints Development
  • 19. 19 A Globally Distributed Player Base US users EU users Australia users Communication MySQL Redis API US EU AUS Websocket Geo Load Balancer
  • 21. 21 Profile and Session Management MySQL Signed URL Profile pictures Bucket Edge Cache Public pictures Bucket Session information Redis User registration and login User frontend PD SSD Image metadata
  • 22. 22 Smart client Smart backend Push to Phone Web sockets In-game real time notifications Push notifications OR
  • 23. 23
  • 24. 03 How to build mobile games using App Engine and Cloud Endpoints ?
  • 25. 25 Griddler - multiplayer riddle mobile game
  • 26. 26
  • 27. 27 Responsibilities of the mobile game backend include : ● Serving board definitions to the clients ● Managing the list of players and their statistics (for example, how many games a player played across different devices, how many multiplayer games she won) ● Managing the list of devices used by players in order to be able to send push notifications to these devices ● Sending game invitations for multiplayer games ● Relaying invitation acceptance, declines and cancellations
  • 28. 28 Key components of mobile gaming solutions ● The mobile game client applications ● The mobile game backend ○ Griddler API includes methods for: ■ Game Management, for example startNewSinglePlayerGame and gameFinished ■ Player Invitations, for example sendInvitation, acceptInvitation etc. ■ Notifications, for example registerDeviceForPushNotification
  • 29. 29 Communication between clients apps and your mobile game backend @Api annotation API call from the client
  • 31. 31 Optimizing data access with Memcache A backend running on Google App Engine can use a distributed in-memory, data cache service called Memcache to store and retrieve frequently accessed data
  • 32. 32 ● Make a game more engaging and social ● Task Queues ○ Push Queue : Sending the enqueued tasks (push model) to your code running on Google App Engine as HTTP requests to a chosen URL ○ Pull Queue : Mobile backend code can pull the tasks from the queue / Process the tasks outside of App Engine Asynchronous processing with Task Queues
  • 36. 36
  • 37. 37 Firebase is a powerful platform for mobile and web applications.
  • 38. Static HostingRealtime Database User Authentication
  • 39. Web Framework Integrations Server Side Access Client SDKs
  • 41. Three Tier Architecture device application server database
  • 42. Two Tier Architecture Firebasedevice ● Fast Development ● Offload Scaling ● Unified Security
  • 45. // Create a Firebase database reference var ref = new Firebase("https://googleformobile.firebaseio.com"); // Write data from Firebase ref.set("Hi GCP WorkShop!"); // Read data from Firebase ref.on("value", function(snapshot) { var data = snapshot.val(); console.log(snapshot.val()); });
  • 46. "rules": { "foo": { // /foo/ is readable by the world ".read": true, // /foo/ is writable by the world ".write": true, // data written to /foo/ must be a string less than 100 characters ".validate": "newData.isString() && newData.val().length < 100" } }
  • 51. Authentication Email & Password Third Party Providers (Google, Facebook, Twitter, GitHub)
  • 52. // Facebook Authentication var ref = new Firebase("https://googleformobile.firebaseio.com"); ref.authWithOAuthPopup("facebook”, function(error, authData) { if (error) { console.log("Login Failed!", error); } else { console.log("Authenticated successfully with payload: ", authData); } });
  • 53. "users": { "$uid": { // /users/$uid is globally readable ".read": "true", // but only personally writable ".write": "auth.uid == $uid" } }
  • 55. Hosting SSL by default Backed by a global CDN Custom domain support
  • 56. > firebase init Initializing app… Successfully initialized > firebase deploy Progress: 100% Successfully deployed
  • 60. 60 Resources Firebase docs: firebase.com/docs Cloud docs : cloud.google.com/docs Join the discussion bit.ly/gcp-slack bit.ly/gcp-githubbit.ly/gcp-twitter gcpug.kr