写点什么

Multi-Site High Availability Architecture solution of Honor of Kings mall

作者:David
  • 2022-12-05
    澳大利亚
  • 本文字数:1277 字

    阅读完需:约 4 分钟

Background

Honor of Kings, is a multiplayer online battle arena developed by TiMi Studio Group and published by Tencent Games for the iOS and Android mobile platforms for Mainland China. Released in 2015, it has become one of the most relevant MOBA games in mainland China.


This article is the Multi-Site High Availability Architecture solution of the game's mall where users can purchase game skins and tools.

The difference between this mall and a traditional online store is:

  • our game mall is all digital products

  • we don't need to worry about inventory and logistics.

Business Features

We have lots of features, but based on priority, our core features are:

Core features: login, recharge (top up), purchase

Users have to log in first for any other activities, eg: playing, purchasing a skin, etc. So login is the top priority.

For the online mall, top-up and purchasing are the other top priorities.

Data

  • RoleId: immutable and globally unique. Only need to link the user id to the server id.

  • Recharge transactionId: all the transactions are happening in WeChat pay or QQ pay. Honor of Kings (HoK) doesn't need to do anything with the transactions but only a record of the transaction associated with the user id and server id (the server which the user play). Also, this record is immutable.

  • Vouchers: HoK's currency. Linked with user id and server id.

  • Purchase records: this record will include information of: product id (globally unique), amount of product, server id, user id, transactionId (globally unique) and timestamp. The whole record is immutable.

Data Sync

  • RoleId: immutable and globally unique, associated with server id. Only need to sync new data.

  • Recharge transactions: immutable. Only need to sync new data.

  • Vouchers: need to guarantee strong consistency. Only need to sync the data.

  • Purchase records: immutable. Only need to sync new data.

Exception Cases

If QQ or WeChat is down, what should we do?

Post an update on our app/website: the top-up feature is temporarily down. And will give an update once QQ or WeChat is back alive.


If the server is down during the user's purchase, what should we do?

Involve our support tea,m and possibly make compensation, e.g. a gift card to the affected customers.


If the user didn't see the latest data due to the data sync latency, what should we do? eg, user can't see their vouchers.

Tell the user that there might be a little bit of latency and suggest they check later. If the situation doesn't improve after 5min, they could submit a help ticket, and our support team will contact them.


Architecture design diagram


发布于: 刚刚阅读数: 4
用户头像

David

关注

还未添加个人签名 2018-03-18 加入

还未添加个人简介

评论

发布
暂无评论
Multi-Site High Availability Architecture solution of Honor of Kings mall_#架构实战营_David_InfoQ写作社区