使用適用於 MySQL 的 Azure 資料庫之遊戲

API 應用程式
內容傳遞網路
適用於 MySQL 的資料庫
HDInsight
儲存體

概觀Overview

此遊戲解決方案架構彈性調整您的資料庫,以容納無法預期的流量高載,並提供全球規模的低延遲多玩家體驗。This gaming solution architecture elastically scales your database to accommodate unpredictable bursts of traffic and deliver low-latency multi-player experiences on a global scale. 此特定案例是以遊戲案例為基礎,但設計模式與許多需要處理高流量 web 呼叫和 API 要求(例如電子商務和零售應用程式)的產業相關。This specific scenario is based on a gaming scenario, but the design patterns are relevant for many industries requiring the process high-traffic web calls and API requests such as e-commerce and retail applications.

架構Architecture

架構圖表會 下載此架構的SVGArchitecture Diagram Download an SVG of this architecture.

資料流程Data Flow

  1. Azure 流量管理員將使用者的遊戲流量路由傳送至 Azure App Service、函式或容器中裝載的應用程式,以及透過 Azure API 閘道發佈的 Api。Azure Traffic Manager routes a user's game traffic to the apps hosted in Azure App Service, Functions or Containers and APIs published via Azure API Gateway.
  2. Azure CDN 會將靜態影像和遊戲內容提供給儲存在 Azure Blob 儲存體中的使用者。Azure CDN serves static images and game content to the user that are stored in Azure Blob Storage.
  3. 適用於 MySQL 的 Azure 資料庫會將使用者的遊戲資料儲存在所裝載的交易式資料庫中。Azure Database for MySQL stores user's game data in a transactional database hosted.
  4. 適用於 MySQL 的 Azure 資料庫中的資料會使用 Azure Databricks 處理,並儲存在分析平臺中。The data from Azure Database for MySQL are processed using Azure Databricks and stored in the analytics platform.
  5. (選擇性) 使用 Power BI 來解讀此資料並建立新的視覺效果(Optional) Use Power BI to interpret this data and create new visualizations

單元Components

此架構包含下列元件:This architecture includes the following components:

  • Azure 流量管理員 是以 DNS 為基礎的負載平衡器,可控制不同 Azure 區域中服務端點的使用者流量分配。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 管理 提供位於遊戲 api 前方的 API 閘道。Azure API Management provides an API gateway that sits in front of the Gaming APIs. API 管理也可以用來執行下列考慮:API Management also can be used to implement concerns such as:

    • 強制採用使用量配額和頻率限制Enforcing usage quotas and rate limits
    • 驗證 OAuth 權杖以進行驗證Validating OAuth tokens for authentication
    • 啟用跨原始來源要求 (CORS)Enabling cross-origin requests (CORS)
    • 快取回應Caching responses
    • 監視和記錄要求Monitoring and logging requests
  • Azure App Service 裝載 API 應用程式,允許自動調整及高可用性,而不需要管理基礎結構。Azure App Service hosts API applications allowing autoscale and high availability without having to manage infrastructure.

  • Azure CDN 從使用者附近的位置傳遞靜態、快取的內容,以減少延遲。Azure CDN delivers static, cached content from locations close to users to reduce latency.

  • Azure Blob 儲存體 已優化,可儲存大量的非結構化資料,例如靜態遊戲媒體。Azure Blob Storage are optimized to store large amounts of unstructured data, such as static gaming media.

  • 適用於 MySQL 的 Azure 資料庫 是完全受控的關係資料庫服務,以開放原始碼 MySQL 資料庫引擎的社區版本為基礎。Azure Database for MySQL is a fully managed relational database service based on the community edition of the open-source MySQL database engine.

  • Azure HDInsight 是雲端中適用于企業的受控、全方位的開放原始碼分析服務。Azure HDInsight is a managed, full-spectrum, open-source analytics service in the cloud for enterprises. 您可以使用開放原始碼架構,例如 Hadoop、Apache Spark、Apache Hive、LLAP、Apache Kafka、Apache Storm、R 等等。You can use open-source frameworks such as Hadoop, Apache Spark, Apache Hive, LLAP, Apache Kafka, Apache Storm, R, and more.

  • (選擇性的) Power BI 提供具有視覺效果的互動式儀表板,以使用儲存在 SQL Server 中的資料來推動預測的決策。(Optional) Power BI provides an interactive dashboard with visualization that uses data stored in SQL Server to drive decisions on the predictions.