Google Cloud Platform Blog
Product updates, customer stories, and tips and tricks on Google Cloud Platform
Developer Insights: Building scalable social games on App Engine
Thursday, October 18, 2012
Today’s guest blogger is Hernan Liendo, CTO of
Zupcat
, developer of social games played by millions of people worldwide. Hernan shares his team’s experience using App Engine to build
RaceTown
, a multiplayer racing game.
Choosing a cloud service provider
RaceTown is one of Zupcat’s most popular games; it has almost 900,000 monthly unique users, opens more than 40,000 connections via the
Channel API
per day, processes more than 15,000 queries per second and delivers terabytes of content everyday. When deciding our architecture, we took into account several unique requirements of social games:
High uptime
Short loading time
Flexibility to deal with social network API changes
Ability to manage thousands of players, concurrently, from all over the world
Adjustment to capabilities and performance issues on different users’ computers
Ability to measure user actions to constantly improve the user experience
Hosting and delivering quality, beautiful game art
Complex game domains and algorithms: such as enemy adaptable performance, path finding, and 2D and 3D rendering
App Engine addresses these complicated issues. It provides few tracerouting hops from almost anywhere in the world, great uptime, automatic scalability, no need for infrastructure monitoring and a reasonable price for content delivery.
Implementing App Engine
The diagram above shows a simplified view of our game architecture. We’ve discovered that App Engine is good to use not only as a game backend server, but also as a metrics server and content delivery network. In addition, we periodically synchronize game state and retrieve data to and from the server.
The
App Engine Datastore
is great because it has high availability and easily handles hundreds of millions of rows of data, which is important for social games. For example, we can easily scan the Datastore to present high score information and gamer stats to the user. Additionally, because gamers tend to spend lot of time during a game session, we’ve found it’s helpful to cache game data. Using
Memcache
, we have significantly reduced Datastore API calls and lowered users’ waiting time.
Another tip for App Engine developers - although App Engine API failures are uncommon, you must be sure to write proper retrying code to minimize the possibility of exposing users to an application crash. RaceTown performs almost a hundred million operations daily, and proper client side retrying algorithms have enabled us to reduce failure rates to very low levels.
Final thoughts
I believe that today there is no technology that matches App Engine. You can run your code and store your data in the very same servers that Google uses. Migrating your applications to this technology means you have to start thinking in a cloud-centric way and reinvent your architecture to stop working inside a relational database and classic clustered web server.
If you can achieve this, your products will be delivered using the same infrastructure that Google uses, without a huge corporate budget!
- Contributed by Hernan Liendo, @hernanliendo of Zupat, @zupcat
Free Trial
GCP Blogs
Big Data & Machine Learning
Kubernetes
GCP Japan Blog
Firebase Blog
Apigee Blog
Popular Posts
Understanding Cloud Pricing
World's largest event dataset now publicly available in BigQuery
A look inside Google’s Data Center Networks
Enter the Andromeda zone - Google Cloud Platform’s latest networking stack
Getting your data on, and off, of Google App Engine
Labels
Announcements
193
Big Data & Machine Learning
134
Compute
271
Containers & Kubernetes
92
CRE
27
Customers
107
Developer Tools & Insights
151
Events
38
Infrastructure
44
Management Tools
87
Networking
43
Open
1
Open Source
135
Partners
102
Pricing
28
Security & Identity
85
Solutions
24
Stackdriver
24
Storage & Databases
164
Weekly Roundups
20
Feed
Subscribe by email
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.
Learn More
Technical questions? Check us out on
Stack Overflow
.
Subscribe to
our monthly newsletter
.
Google
on
Follow @googlecloud
Follow
Follow