Docs Menu
Docs Home
/

Streamline Global Gaming Management

Streamline game data management with MongoDB Atlas.

Use cases: Analytics

Industries: Media

Products: MongoDB Atlas, MongoDB Atlas Global Clusters, MongoDB Atlas Search, MongoDB Atlas Charts, MongoDB Aggregation, MongoDB Atlas Data Federation

Partners: Unity Game Engine, Amazon EC2

In the gaming industry, managing data such as player profiles, inventory, and game states is a challenge. This solution, named Leafsteroids, uses MongoDB Atlas to streamline and improve game data storage. Atlas Clusters hold player profiles, Atlas Charts enable real-time player dashboards, and Atlas Search enables user-friendly search interactions. This solution allows for global scalability, efficient data management, and user-focused design.

The following diagram displays what a game data management system looks like without MongoDB:

Reference Architecture Without Atlas
click to enlarge

Figure 1. Reference architecture without Atlas

This approach involves building a global query router, replication services betweeen multiple nodes across the globe, and integrating different storage options. The architecture also requires a separate search engine and visualization tool, with a serverless query service to federate the data into the visualization tool.

In contrast, the following diagram displays game data management architecture with MongoDB:

Reference architecture with Atlas
click to enlarge

Figure 2. Reference architecture with Atlas

With MongoDB Atlas, you can host your data, generate visualizations, and perform search on a single platform by using MongoDB Atlas Global Clusters, Online Archive, Atlas Search, Atlas Charts, and Atlas Data Federation.

The following diagram displays the data models used by this solution:

Data model approach illustration

Figure 3. Data model approach illustration

A Recording represents a player's gameplay from an event, including scores, moves, and statistics. Each Recording stores a subset of the Player and Event data types by using the extended reference pattern. This design enhances query performance by allowing selective field embedding. Additionally, it offers flexibility to add and change data in the future.

In massive online games with billions of players like PUBG, data locality is critical for optimal experience and to satisfy legal requirements. To support these needs, the Players and Recordings collections are sharded based on location ISO codes. Atlas Global Clusters associates ISO Country and Subdivision codes to zones of shards in a specific cloud region. This is used to route query and write requests, ensuring the best performance.

For detailed instructions on how to build this solution, see the GitHub repository.

This solution provides the following architecture features:

  • Atlas Global Clusters ensure an uninterrupted gaming journey regardless of a player's geographical location. For data precision, player information is stored based on ISO country codes.

  • Atlas Online Archive automatically offloads game data that is older than 90 days to optimize storage. This is especially useful for games with millions of players and game runs, as these generate large amounts of data that can increase costs and impact performance. Additionally, this solution uses Atlas Data Federation so you can access both recent and historic data.

The solution offers the following user highlights:

  • A player dashboard, supported by Atlas Charts, ensures real-time updates on in-game achievements and progress. By using Atlas Charts' filtering and embedding features, you can repurpose dashboards for players and events.

  • Atlas Search provides features such as autocomplete and fuzzy matching, allowing players to search for their nicknames in the Web UI.

This solution's architecture includes the following components:

  • Game Client: Developed using Unity3D, .NET, and C#

  • Game Server: Built on ASP.NET Web API, .NET, C#, and the MongoDB .NET/C# Driver

  • Website: Crafted as a Blazor Server Application using .NET and C#

The README in the GitHub repository contains a more detailed version of the following procedure.

1

Install the .NET SDK 7 and set up your MongoDB Atlas database.

2

Navigate to the rest_service folder in the repository. Modify the .env file and start the backend using the following command:

dotnet run --urls "http://0.0.0.0:8000"
3

Navigate to the website folder. Modify the .env file and start the website by running the following command:

dotnet run --urls "http://0.0.0.0:8001"
4

Navigate to the game_client folder. Modify the .env file in the Assets folder. Then, run the game.

  • Global clusters promote scaling: Use global clusters, read from secondary, and write to primary to scale horizontally and cater to a global audience without side effects and latency.

  • MongoDB's document model promotes flexibility and performance: Leverage the document model to store all data for a single game run in a single document, but serialize a subset during run time to boost performance.

  • Shard data based on player location: By storing data based on ISO codes, Atlas Global Clusters enable increased performance and easier scalability, allowing shard and zone additions without service disruptions.

  • Sigfrido Narvaez, MongoDB

  • Dominic Frei, MongoDB

  • Hubert Nguyen, MongoDB

  • AI-Driven Media Personalization with MongoDB and Vector Search

  • Editorial Workflows with Gen AI

  • Gen AI-Powered Video Summarization

Back

Unified Namespace Data Integrity

On this page