Links

Sync Cluster

ObjectBox Sync Cluster for scalability and high availability.
The ObjectBox Sync Cluster distributes the Sync load among multiple Sync Servers. This setup has two main advantages over a single server setup. First, more servers can be added to scale with e.g. with a growing number of clients. Second, availability increases because there's no single point of failure because other servers can take over.

Prerequisites

You need to get the Sync Server executable / Docker from ObjectBox. It must also contain the "Cluster" feature (when in doubt, just try it and/or check the Admin UI web app).

Cluster setup

Typical cluster setups consist of an odd number of servers. For example, three Sync Servers can form a cluster that can compensate one server to be down.
Some general notes:
  • Model: all servers need to operate the same model file

Configuration

The base configuration of the Sync Server is described here. Using the same configuration file, these are the Cluster specific options:
{
// ... Standard config as described in "ObjectBox Sync Server" goes here
"clusterId": "myCluster",
"serversToConnect": [
{
"uri": "ws://1.2.3.4:5678",
"credentialsType": "SHARED_SECRET",
"credentials": "securePassword"
},
{
"uri": "ws://1.2.3.5:6789",
"credentialsType": "SHARED_SECRET",
"credentials": "securePassword"
}
]
}
  • clusterId: an identifier for the cluster. It's an arbitrary string and has to be the same on all servers involved in a cluster.
  • serversToConnect: for each server, the other servers of the cluster must be specified here. Each entry can specify the following fields:
    • uri (required): the URI of the Sync Server; which has to be a WebSocket URI
    • credentialsType is required (unless you are using unsecuredNoAuthentication) and should be SHARED_SECRET_SIPPED.
    • credentials (required): given credentialsType, this is actual secret.
Note: while most of the options can be specified either in the Sync Server command line and in the JSON file, the serversToConnect options is JSON file only. Thus, if you want to configure clustering for your Sync Server, please use a JSON configuration file as described here.