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.
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).
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
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: 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
credentialsTypeis required (unless you are using unsecuredNoAuthentication) and should be
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
serversToConnectoptions is JSON file only. Thus, if you want to configure clustering for your Sync Server, please use a JSON configuration file as described here.