Data Abstraction
This second part explains "title and region isolation", which reflects one of the characteristics of data abstraction in PGOS.
1. Three Levels of Data
The data model structure of PGOS is abstracted into three levels: the title level, player level, and battle level. Data in each level have different permissions that protect them from illegal access.
Before diving into a detailed description of PGOS's data storage service, we should understand the following key points first:
- Title region config data is a set of configuration data belonging to the title region, and it is read-only for the game client/server.
- Player data includes basic player information and customizable KV pair data, which will be covered in detail later.
- Battle data includes match settlement data, which is written by the game server and is read-only to the game client.
2. Player Data Template
The main difficulty in the design of a storage service that keeps all player data is the wide variety of demands of different games.
The PGOS solution enables developers to customize data templates according to their preferences, submit them on the web portal, and then use them in their games as needed.
Developers can modify the player data template by adding or removing keys, setting default values for specific keys, and limiting access by setting permissions. The order of the keys can even be modified if required.
Furthermore, the template remains editable after the game is released, and there is no need to worry about performance issues when adding keys to existing templates since PGOS adopts a mechanism called "create on access" or "lazy creating", which makes modification easy while also retaining high performance.
Generally speaking, the three levels of data mentioned above make up the data storage service of PGOS. It is easy to use and can be flexibly used in many scenarios.