Skip to main content

Extensions & Flexibility

The entire system is packed with various services, and a microservices architecture pattern is adopted instead of using a monolithic structure with different layers. This enables developers to add and modify interactions between the corresponding services. This is what we called "extensions and flexibility".

1. Concept of Extension

image_16342824157312

Some events are triggered when a game runs on PGOS, such as when:

  • A player logs in to the game
  • A battle with several players is generated
  • A battle is over and a winner is declared
  • ……

If you care about specific types of events, you can write a Virtual Server with any languages(NodeJS, Python and Golang, etc) and subscribe to these events, so your code will be executed when an event of that type occurs. There is also a webhook mechanism that starts an HTTP request with the URL specified, which provides a way to integrate a 3rd-party system or your own backend with PGOS. These are called the Event Stream and Virtual Server systems.

In fact, EventStream is so widely used in PGOS internally that we decided to make it accessible to all developers.

2. Virtual Server

image_16342811995562

Virtual Server is a concept in the PGOS roadmap which will encapsulate Virtual Server written by developers in containers and make them accessible to game clients through PGOS gateway.

The goal of using a virtual server is to minimize the workload of deploying the backend of a game. This can be handy in scenarios where developers have to write backend code to implement some online logic.

3. Virtual Server Storage

Considering that you may need store some data for Virtual Server, PGOS provides Virtual Server Storage service. Virtual Server Storage are essentially databases(Redis/MongoDB, etc) provided by cloud provider, PGOS wraps these databases into a out of box services. After creating instances of Virtual Server Storage, your Virtual Server can access them directly. You can also modify the database spec on the PGOS Portal any time, monitor them by deploying the Prometheus Exporter in Virtual Server System as well.