Regardless of whether you are a startup-level game developer or an established enterprise-level AAA company, there are certain challenges embedded in the game development process and are ubiquitous across the entirety of the current multi-user cloud-based gaming landscape. Aside from making sure that your game is enticing and innovative in terms of gameplay, game development companies also need to provide a plethora of additional features to their players, including leaderboards, recurring challenges, friend lists, different multiplayer modes, and content releases, alongside taking care of reviews, marketing channels, and sales.
All these elements account for a rather complex ecosystem of various components involved in a successful game development process and launch. That said, it is critical for game dev teams to have a strong, reliable, and scalable cloud-based infrastructure in order to deliver the results their users are expecting.
The Need for Backend Scalability & AWS Gaming as a Solution
The backend architecture typically consists of two types of servers:
- actual game servers for multiplayer games
- servers dedicated to additional game services and features (chat, matchmaking, etc)
These infrastructures need to be capable of seamlessly and instantly scaling up in case the user-base explodes from 100 to 100,000 active players, while at the same time be cost-effective so as not to cause overheads when there’s no need for servicing as many players.
Let’s take Epic Games’ Fortnite, for example. This platform hosts over 350 million players worldwide (data from May 2020), which means it requires a highly reliable and scalable backend architecture in order to provide its players with a high-end, low-latency gaming experience. Otherwise, this gaming giant would lose thousands of users daily due to infrastructure or application issues.
This is where AWS gaming and game tech services come into play.
Epic chose AWS gaming services (or AWS Game Tech services to be more precise) so its battle-royale type game would be able to withstand enormous surges in the number of concurrent players. It is no secret that AWS gaming services provide its clients with the most powerful cloud architecture solutions in terms of:
- Cost optimization
Not only does AWS gaming architecture services provide game development companies with the right tools necessary for building actual games, but it also equips them with proper solutions for when it’s time for a certain project to evolve, pivot, and scale up/down (in terms of both capacity and costs) according to current player demands.
General Guidelines for Building Scalable AWS Gaming Cloud Architecture
Much like it is the case with almost any other type of digital architecture, there’s no one-size-fits-all set of best practice tips for developing an AWS gaming server architecture and additional infrastructure that would be a silver-bullet solution. Your project and its success depend on myriad factors, but one goal is common for all: build a well-architected and reliable AWS gaming framework capable of effortlessly enduring sudden and massive influxes of players, as well as keeping all other features and processes at optimal operational conditions.
That said, let’s delve into some key best practice guidelines for building a strong, scalable, and highly operational cloud architecture with AWS gaming services.
Deploying Amazon Route 53
The importance of the Domain Name System (DNS) for the functionality of the entire internet is rather obvious, rendering the use of Amazon Route 53 highly logical for your product. Amazon Route 53 is deployed for connecting user requests to infrastructures running in AWS including Amazon EC2 instances, Elastic Load Balancers, or Amazon S3 buckets, as well as routing users to infrastructures outside of AWS.
In a cloud-based gaming environment, Route 53 is used for managing the records necessary for mapping players to your AWS gaming infrastructure. This service features highly pragmatic and powerful routing policies enabling a game development company to have more granular control of how their players are connected and mapped, thus having a critical role in the accessibility and dynamic scalability.
Opting for Amazon EC2 Services
The backend of your production environment needs to be deployed in a fault-tolerant manner, which calls for Amazon EC2. EC2 is hosted in multiple AWS Regions worldwide and provides secure, resizable compute capacity designed to enable easier web-scale cloud computing for developers. It features a simple and user-friendly web service interface that makes sure you are capable of obtaining and configuring capacity with minimal friction, while it also provides an environment of unlimited control in terms of computing resources.
We recommend opting for a region that is in the physical vicinity of the majority of your players, allowing for a low-latency gaming experience. Each region features multiple, isolated locations known as Availability Zones, often referred to as logical data centers. Though isolated physically, these Availability Zones are connected and form high-speed networks. In order to further increase the availability of your game, we recommend balancing your servers across multiple Availability Zones within a single region. For example, deploying two Availability Zones is a great way to optimize costs and reliability by coupling your databases, servers, and cache instances.
Elastic Load Balancing
In order to scale up as your user-base expands, we recommend leveraging stateless protocols by creating an HTTP/JSON API for the majority of game features. This allows you to dynamically add instances and more easily bounce back after transient network issues. The backend typically consists of a server that is HTTP/JSON-friendly, uses S3 for binary content and stores data in MySQL, therefore enabling effective development and scaling.
As per AWS: “A common pattern for game developers is to run a web server locally on a laptop or desktop for development, and then push the server code to the cloud when it’s time to deploy. If you follow this pattern, AWS Elastic Beanstalk can greatly simplify the process of deploying your code to AWS.”
Here’s a high-level overview of a game backend running on AWS:
Elastic Load Balancing is used for the automatic distribution of incoming app traffic across multiple Amazon EC2 instances, enabling you to achieve fault tolerance in your applications, as well as further boost availability, automatic scaling, and security levels.
Additional Scalability with Elastic Beanstalk
AWS Elastic Beanstalk deploys and scales web applications and services developed using Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker, and does it on familiar servers such as Apache, Nginx, Passenger, and IIS. Gaming companies can simply upload their code and this service will automatically handle deployment processes including load balancing, capacity provisioning, auto-scaling, application health monitoring, etc; while retaining complete control over the AWS resources that are fuelling your application.
Elastic Beanstalk is capable of automatically deploying across multiple Availability Zones, for which we recommend reading the following guide Auto Scaling Group for Your Elastic Beanstalk Environment. Automatic scaling can improve scalability via adding and removing instances from these Availability Zones. For optimal performance, you can modify the automatic scaling trigger to specify the threshold and the metric (CPU usage, for example) based on the performance profile of your app. This allows for Elastic Beanstalk to automatically launch additional instances should the threshold you previously specified is reached. For more information on this topic, we recommend reading the HTTP Automatic Scaling section here.
Should I Use Single or Multiple Availability Zone for Optimized Development/Testing?
Typically, it is sufficient to use a single Availability Zone for development and test environments, since that way you can optimize costs more easily. Now, failure-based events may cause downtime, but if your development environment employs QA testers for build validation during low-traffic hours, it is recommended that you treat this more like a production environment, in which case it is probably better to leverage multiple Availability Zones like you would in production stages.
Set Up Load Balancer for Improved Security & Optimized Servers
AWS recommends setting up load balancers to handle SSL termination in order to offload SSL encryption/decryption from backend servers on which the game is running. You can read more about this method in this guide for Configuring HTTPS for Your Elastic Beanstalk Environment within the AWS Elastic Beanstalk. When it comes to game backend security, it is strongly advised to use SSL. For more Elastic Load Balancing tips, follow this link: HTTP Load Balancing.
Use Containerization for Resiliency & More Efficient Server Usage
Modern OS-level containerization (like Docker, rkt, LXC, OpenVZ) allows developers to create containerized workloads through which your code is using the servers in a more efficient manner. Deploying resilient container infrastructures enables a more rapid deployment compared to traditional applications, which allows devs to streamline packaging and testing of their apps, and more easily scale different workflow components.
AWS services such as Amazon Elastic Container Repository (ECR), Amazon Elastic Container Service (ECS), and Amazon Elastic Container Service for Kubernetes (EKS) enable operators to orchestrate the deployment of containers and manage container images over an existing EC2 workload (or without any servers using ECS in Fargate mode). In an environment where infrastructure is loosely coupled and the app servers are stateless, operators are capable of achieving more seamless scalability. They can also launch new region clusters, deploy images, and manage fleets more easily as these processes are treated as homogenous computing resources.
Use Amazon CloudFront & S3 for a Flawless & Engaging Gaming Experience
In order to achieve a fast, durable, and reliable gaming infrastructure that provides your players with a minimum-latency gaming experience, we recommend using Amazon CloudFront and Amazon S3 services.
Amazon CloudFront is a top-tier CDN (Content Delivery Network) service that delivers apps, APIs, data, and videos to users all around the globe through a low-latency, high transfer speed, and developer-friendly environment. It is an optimal solution for your game’s global presence, especially if you couple it with Amazon S3.
Amazon S3 is an easy-to-use storage service that allows game development companies to achieve superior levels of data availability, security, scalability, and performance. It provides highly-functional management features and allows developers to configure and finely tune access controls in order to meet their unique business, organizational, and compliance requirements.
With 225+ PoPs (Points of Presence) across over 46 countries (at the time of writing), your game will have 99.999999999% uptime and durability.
This is critical for game developers who need a way to securely deliver data, rich media, and entire games to their respective players and do that with low-latency and high transfer speeds.
Tracking & Analyzing Player Activity for Improved Performance
AWS gaming architecture solutions aren’t just about providing a scalable and sturdy architecture. They are also about improving the performance of your entire project through granular data analysis and gaining valuable insights into how to improve the performance of both your infrastructure and your actual game.
As players generate vast amounts of activity data, game development companies are capable of storing, monitoring, and closely analyzing user data through the following AWS gaming services: Amazon Kinesis, Amazon EMR, Amazon S3, and Amazon Athena. These platforms enable massive data streaming to your backend storage systems, allowing you to perform granular data analyses and drive better decision-making in terms of gameplay quality, user-friendliness, and overall success of your products.
Deploy AWS Managed Databases for Increased Reliability
Game development companies require reliable databases (both relational and non-relational) for storing user data, including basic information about the players, their profiles, gameplay progress, achievements, etc.
This is where AWS database engines and technologies come into play.
Some of the most widely used non-relational DBs include Amazon DynamoDB, Amazon DocumentDB, while we recommend Amazon RDS and Amazon Aurora, as well as Amazon Neptune for graph databases. All these managed AWS database services are designed for top-shelf performance and reliability and are capable of scaling up and down according to your game’s needs.
A Production-Ready Horizontally Scalable AWS Gaming Architecture
The following diagram showcases a game backend supporting a wide range of game features including login, leaderboards, challenges, chat, binary game data, user-generated content, analytics, and online multiplayer.
Ready to Leverage The Power of AWS Gaming Services?
Although AWS offers top-tier services for building a strong, resilient, scalable, and extremely reliable gaming architecture, this entire process involves numerous moving parts and a rather complex ecosystem of components and steps to consider. Since each game development process has its own set of challenges and not every company has the same workflow, it is highly recommended to work with an experienced AWS partner who knows how to tailor these AWS gaming services according to your specific needs and end-product goals. Only then will you be able to easily build a properly scalable AWS architecture.