Deployments and the Runtime
Before you read this page, you should read:
SpatialOS hosts games for you. We call an instance of a running game a deployment.
As you learned in Workers and load balancing, you decide how many server-worker instances your world needs, and how to organise them across the world. In a deployment, SpatialOS starts those server-worker instances for you, running them on machines in the cloud (and orchestrating this for you - you don’t need to interact with the machines directly).
SpatialOS also mediates client-worker connections.
A deployment run is a deployment that you launch at a specific time with a specific name, assembly, and snapshot. Each deployment run is assigned an
int64 number as a unique identifier, which is called the Run ID.
You might find the Run ID useful in situations when the deployment name is not enough to uniquely identify a specific run of deployment. For more information, see Deployment runs.
The SpatialOS Runtime manages your game world. There is one Runtime instance for every game deployment. It is made up of the following parts:
- Entity database: Holds the canonical store of all SpatialOS entity data.
- Bridge: Handles server-worker and client-worker instance connections and manages their read access.
- Load balancer: Coordinates each worker instance’s write access to the entity database.
Each server-worker and client-worker connection is assigned a unique bridge that communicates with other parts of the Runtime on the worker instance’s behalf. The bridge makes sure the worker instance only receives updates about the part of the game world that it is allowed to receive updates about.
Your worker instances don’t communicate with the entity database directly. Instead, when a worker instance wants to make a change to an entity, it sends that request to its bridge. The bridge then forwards the request to the entity database on the worker instance’s behalf.
2019-09-11 Page created with editorial review: Moved “Deployments” section here from the “Workers and load balancing” page; added “Runtime” section