Captain Strike
Release Date: 9-4-2014
Platform: IOS, Android
Total Download: 20M+
Peak DAU: 30k
Peak CCU: 3k
Game Loop
• Action Phrases • Activities
- Buy and Upgrade items
- Lottery
- Quest, Event, Achievement
- Leaderboard competition
- …….
Part 1
Backend Architecture
Backend Architecture
Database
Cache
API Services
Room
Controller
Room
Room
Room
Room
Server1 Server2
Databases
• MongoDB
- NoSQL with dynamic query
- Good performance on big data
- Predefine index on Schemaless data
• Redis
- Blazing fast
- Store rapidly changing data and caching recently query
API Services
• HTTPS
- The security capabilities of SSL/TLS to standard HTTP communications
- Easy to develop and deploy
• Python
- Widely used general-purpose, high-level programming language
- Multi Platform
- A huge number of frameworks and modules
Game Room
• Standalone Application
- Standalone process under managed of Room Controller
• Forwarder
- Synchronize player game ‘s world with others
• Referee
- Watches a game closely to ensure that the rules are adhered.
Room Life Circle
• Load Configuration
• Waiting for match start
Initializing
• Game Logic Processing
• Synchronize game world
and collecting data
Playing
• Calculating score
• Update User Profile via API
Service
Scoring
Distributed Room
Database
Cache
API Services
Room
Controller
Room
Room
Room
Room
Server1 Server2
Part 2
Working Flow
Design Principles
• Client just a “Display Screen”
• Online configuration
• Focusing on active user
Authenticate
• Token base authentication.
- API Service generate an opaque string that
identifies a user ( Token )
- User must provide Token to API Service when
make request to server
- Token have a lifetime of about an 4 hours
User Profile
• Client Read-only
– Client don’t have authorize to change/modify user
profile
– User send action to server. Server check valid and
update user profile according to that action
Ex:
Client: “Buy a gun id=10”
Server: Check money, level, …. Perform transaction
and update user profile
Quests and Events
• Action and Target ID
– Quest is an accumulate number of Action and TargetID.
Quest Complete when acc number equal or greater than
requirements
– Each Quest/Event has their own requirement to activated
• Competition Rewards
– Competition rewards do not automatically delivery to user.
User should call API to check and receive it after login
complete
Part 3
Lessons Learned
Connection
• Minimize long live connections
• Transmit data as quickly as possible Using UDP
instead of TCP for real-time multiplayer
• Be careful with packet loss
• Ping is not constant!
Request/Response
• Minimize number or request to limit the
impact of ping
Ex: Instead of send 3 api ( /getprofile, /getemail, /getconfig )
We can combine them together using Batch API
• Not all requests can be processed in parallel!
Online Parameters
• Online parameters are very important. It can
help you balance/configuration your game
without update your application
• Use DNS instead of IP address for server URL
• Using Cache to improve server performance
Tracking System
• Always track critical information ( User
purchase, User Profile change, … )
• Pay attention to your tracking record design
• Analyze data to understand your audiences
Q&A
Thank you for your time!

More Related Content

PPTX
Kinh nghiệm phát triển Captain Strike
PPTX
Adopting serverless
PPTX
Serverless Solutions for developers
PPTX
Serverless Computing with Azure Functions Best Practices
PPTX
MongoDB.local Austin 2018: MongoDB Atlas for Your Enterprise
PPTX
NServiceBus_for_Admins
PPTX
SOAP Monitoring
PPTX
Mj hd open nms
Kinh nghiệm phát triển Captain Strike
Adopting serverless
Serverless Solutions for developers
Serverless Computing with Azure Functions Best Practices
MongoDB.local Austin 2018: MongoDB Atlas for Your Enterprise
NServiceBus_for_Admins
SOAP Monitoring
Mj hd open nms

What's hot (18)

PPTX
Scale your signalR realtime web application
PPTX
AWS SQS SNS
PPTX
Migrating It Infrastructure To Open Source
PPTX
ServerlessPresentation
PPT
Power Your Mobile Applications On The Cloud [IndicThreads Mobile Application ...
PPTX
AWS Jungle - Lambda
PDF
Building and Scaling a WebSockets Pubsub System
PDF
A 7 architecture sustaining line live
PPTX
SignalR Overview
PDF
Real User Monitoring: Getting Real Data from Real Users in the Real World - S...
PPTX
Qui Quaerit, Reperit. AWS Elasticsearch in Action
PPTX
Serverless
PDF
Serverless computing
PPTX
How to create a Function App on Cosmos DB
PPTX
Lambda and serverless - DevOps North East Jan 2017
PDF
Production deployment
PPTX
Jumpstart: Introduction to Atlas, Highlighting Enterprise Features
PPTX
AWS DirectConnect fundamentals
Scale your signalR realtime web application
AWS SQS SNS
Migrating It Infrastructure To Open Source
ServerlessPresentation
Power Your Mobile Applications On The Cloud [IndicThreads Mobile Application ...
AWS Jungle - Lambda
Building and Scaling a WebSockets Pubsub System
A 7 architecture sustaining line live
SignalR Overview
Real User Monitoring: Getting Real Data from Real Users in the Real World - S...
Qui Quaerit, Reperit. AWS Elasticsearch in Action
Serverless
Serverless computing
How to create a Function App on Cosmos DB
Lambda and serverless - DevOps North East Jan 2017
Production deployment
Jumpstart: Introduction to Atlas, Highlighting Enterprise Features
AWS DirectConnect fundamentals
Ad

Similar to Captain strike backend post-mortem (20)

PPTX
Photon Session / Unite12 Conference
PPTX
GDC 2013 - Ditching the Server: Making Client-side Only Social Games
PPTX
PlayFab Advanced Cloud Script
PDF
Akka for realtime multiplayer mobile games
PPTX
The Future is Operations: Why Mobile Games Need Backends
PDF
Akka for realtime multiplayer mobile games
PDF
Scalability & Big Data challenges in real time multiplayer games
PPT
Gdco12 kartik ayyar
PPTX
Say hello to the new PlayFab!
PPTX
Final year project presentation
PPTX
RightScale Customer Use Case - Ubisoft
PPTX
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
PDF
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
PPT
Realtime html5 multiplayer_games_with_node_js
PPTX
Game On! Exploring Microservices with a Text-Based Adventure Game
PPTX
Intro to liveops
PDF
GameZBoost Gaming Platform Overview
PDF
Building Multiplayer Games (w/ Unity)
PDF
GameZBoost White Label Gaming Platform
PDF
38199728 multi-player-tutorial
Photon Session / Unite12 Conference
GDC 2013 - Ditching the Server: Making Client-side Only Social Games
PlayFab Advanced Cloud Script
Akka for realtime multiplayer mobile games
The Future is Operations: Why Mobile Games Need Backends
Akka for realtime multiplayer mobile games
Scalability & Big Data challenges in real time multiplayer games
Gdco12 kartik ayyar
Say hello to the new PlayFab!
Final year project presentation
RightScale Customer Use Case - Ubisoft
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Unite2014 Bunny Necropsy - Servers, Syncing Game State, Security and Optimiza...
Realtime html5 multiplayer_games_with_node_js
Game On! Exploring Microservices with a Text-Based Adventure Game
Intro to liveops
GameZBoost Gaming Platform Overview
Building Multiplayer Games (w/ Unity)
GameZBoost White Label Gaming Platform
38199728 multi-player-tutorial
Ad

Recently uploaded (20)

PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
E-Commerce Website Development Companyin india
PDF
Workplace Software and Skills - OpenStax
PPTX
How to Odoo 19 Installation on Ubuntu - CandidRoot
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Download Adobe Photoshop Crack 2025 Free
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Computer Software - Technology and Livelihood Education
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PPTX
most interesting chapter in the world ppt
PPTX
Introduction to Windows Operating System
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PPTX
GSA Content Generator Crack (2025 Latest)
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
E-Commerce Website Development Companyin india
Workplace Software and Skills - OpenStax
How to Odoo 19 Installation on Ubuntu - CandidRoot
Visual explanation of Dijkstra's Algorithm using Python
DNT Brochure 2025 – ISV Solutions @ D365
Download Adobe Photoshop Crack 2025 Free
Wondershare Recoverit Full Crack New Version (Latest 2025)
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Topaz Photo AI Crack New Download (Latest 2025)
Computer Software - Technology and Livelihood Education
Full-Stack Developer Courses That Actually Land You Jobs
most interesting chapter in the world ppt
Introduction to Windows Operating System
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
GSA Content Generator Crack (2025 Latest)
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
BoxLang Dynamic AWS Lambda - Japan Edition

Captain strike backend post-mortem

  • 1. Captain Strike Release Date: 9-4-2014 Platform: IOS, Android Total Download: 20M+ Peak DAU: 30k Peak CCU: 3k
  • 2. Game Loop • Action Phrases • Activities - Buy and Upgrade items - Lottery - Quest, Event, Achievement - Leaderboard competition - …….
  • 5. Databases • MongoDB - NoSQL with dynamic query - Good performance on big data - Predefine index on Schemaless data • Redis - Blazing fast - Store rapidly changing data and caching recently query
  • 6. API Services • HTTPS - The security capabilities of SSL/TLS to standard HTTP communications - Easy to develop and deploy • Python - Widely used general-purpose, high-level programming language - Multi Platform - A huge number of frameworks and modules
  • 7. Game Room • Standalone Application - Standalone process under managed of Room Controller • Forwarder - Synchronize player game ‘s world with others • Referee - Watches a game closely to ensure that the rules are adhered.
  • 8. Room Life Circle • Load Configuration • Waiting for match start Initializing • Game Logic Processing • Synchronize game world and collecting data Playing • Calculating score • Update User Profile via API Service Scoring
  • 11. Design Principles • Client just a “Display Screen” • Online configuration • Focusing on active user
  • 12. Authenticate • Token base authentication. - API Service generate an opaque string that identifies a user ( Token ) - User must provide Token to API Service when make request to server - Token have a lifetime of about an 4 hours
  • 13. User Profile • Client Read-only – Client don’t have authorize to change/modify user profile – User send action to server. Server check valid and update user profile according to that action Ex: Client: “Buy a gun id=10” Server: Check money, level, …. Perform transaction and update user profile
  • 14. Quests and Events • Action and Target ID – Quest is an accumulate number of Action and TargetID. Quest Complete when acc number equal or greater than requirements – Each Quest/Event has their own requirement to activated • Competition Rewards – Competition rewards do not automatically delivery to user. User should call API to check and receive it after login complete
  • 16. Connection • Minimize long live connections • Transmit data as quickly as possible Using UDP instead of TCP for real-time multiplayer • Be careful with packet loss • Ping is not constant!
  • 17. Request/Response • Minimize number or request to limit the impact of ping Ex: Instead of send 3 api ( /getprofile, /getemail, /getconfig ) We can combine them together using Batch API • Not all requests can be processed in parallel!
  • 18. Online Parameters • Online parameters are very important. It can help you balance/configuration your game without update your application • Use DNS instead of IP address for server URL • Using Cache to improve server performance
  • 19. Tracking System • Always track critical information ( User purchase, User Profile change, … ) • Pay attention to your tracking record design • Analyze data to understand your audiences
  • 20. Q&A Thank you for your time!