PGX 20.1.1
Documentation

PGX Server Design

PGX is designed for a Server-Client usage model. That is, PGX is designed for the following situation:

  • The PGX server is initiated on a server-class machine, while PGX clients (remotely) connect to the PGX server; multiple clients can connect to the same PGX server at the same time.

  • Each PGX client sends out its requests to the PGX server, and the server returns responses for them. However, these requests are processed by the PGX server asynchronously — they are queued up first and then processed later, when the resources are available. The client can poll the server to check if a request has been finished.

  • Internally, PGX maintains its own engine (i.e. thread pools) for running parallel graph algorithms. The engine tries to process each analysis request concurrently with as many threads as possible.

Note that the 'Standalone Mode' or 'Embedded Mode' is a special case of the Server-Client model, where there is only one client (the PGX Shell or the user application) and the client resides within the same process as the server.

The following figure illustrates the above concepts:

PGX Sever Design

Figure: PGX Server Design

Isolation Between Concurrent Clients

PGX supports data isolation between concurrent clients. Conceptually, each PGX client has its own private workspace, which we call a 'session'. Sessions are isolated — that is, a client cannot access any data from another client's session.

Therefore, each client can load a graph instance (as well as its properties) into its own session, independently from other clients. However, if multiple clients are loading the same graph instance, or if a client is trying to load a graph instance that has already been loaded by another client, the PGX server can share one graph instance between multiple clients under the hood.

Note that in PGX the loaded graph instance and its original properties are immutable, which makes it trivial to share a graph instance among multiple clients. However, each client can dynamically add additional vertex or edge properties to a loaded graph. Such a transient property is private to each session and thus is not visible to other sessions. Similarly, each client can create a mutated version of the loaded graph, in which case the PGX server creates a private graph instance for the client.

The following figure illustrates above explanation.

PGX Data Isolation

Figure: Sessions and Transient Properties