If you'd like to see us expand this article with more information, such as potential use cases, alternative services, implementation considerations, or pricing guidance, let us know with GitHub Feedback!
This gaming solution idea elastically scales your database to accommodate unpredictable bursts of traffic and deliver low-latency multi-player experiences on a global scale. This specific scenario is based on a gaming scenario, but the design patterns are relevant for many industries that are required to process high-traffic web calls and API requests, such as e-commerce and retail applications.
Download an SVG of this architecture.
- Azure Traffic Manager routes a user's game traffic to the apps hosted in Azure App Service, Functions, or Containers, and to APIs that are published via Azure API Gateway.
- Azure CDN serves static images and game content to the user that are stored in Azure Blob Storage.
- Azure Cosmos DB stores user's game state data.
- Azure Databricks correlates, cleanses, and transforms game state data.
- Azure Functions processes the insights derived from Azure Databricks and pushes notifications to mobile devices, by using Azure Notification Hubs.
This architecture includes the following components:
Azure Traffic Manager is a DNS-based load balancer that controls the distribution of user traffic for service endpoints in different Azure regions. During normal operations, it routes requests to the primary region. If that region becomes unavailable, Traffic Manager can fail over to secondary region as needed.
Azure API Management provides an API gateway that sits in front of the Gaming APIs. API Management also can be used to implement concerns, such as:
- Enforcing usage quotas and rate limits
- Validating OAuth tokens for authentication
- Enabling cross-origin requests (CORS)
- Caching responses
- Monitoring and logging requests
Azure App Service hosts API applications allowing autoscale and high availability without having to manage infrastructure.
Azure CDN delivers static, cached content from locations close to users to reduce latency.
Azure Blob Storage are optimized to store large amounts of unstructured data, such as static gaming media.
Azure Cosmos DB is a fully managed NoSQL database service for building and modernizing scalable, high-performance applications.
Azure Databricks is an Apache Spark-based analytics platform optimized for the Microsoft Azure cloud services platform.
Azure Functions are serverless compute options that allow applications to run on-demand without having to manage infrastructure.
Azure Notification Hubs is a massively scalable push notification engine for quickly sending notifications to variety of mobile devices and platforms.
Review the following articles on Cosmos DB:
- Common Azure Cosmos DB Use Cases
- Change feed in Azure Cosmos DB
- Time to Live (TTL) in Azure Cosmos DB
- Consistency levels in Azure Cosmos DB
- Request Units in Azure Cosmos DB
- Partitioning and horizontal scaling in Azure Cosmos DB
- What is Azure Traffic Manager?
- Azure API Management
- Azure App Service overview
- What is Azure CDN?
- What is Azure Blob Storage?
- What is Azure Databricks?
- Introduction to Azure Functions
- What is Azure Notification Hubs?
The following solution ideas feature Azure Cosmos DB: