Ditto 4.1.0
Public Attributes | List of all members
ditto::Global Class Reference

#include <TransportConfig.hpp>

Public Attributes

uint32_t sync_group = 0
 
uint32_t routing_hint = NO_PREFERRED_ROUTE_HINT
 

Detailed Description

Part of `TransportConfig`. Settings not associated with any specific type of transport.

Member Data Documentation

◆ routing_hint

uint32_t ditto::Global::routing_hint = NO_PREFERRED_ROUTE_HINT

The routing hint for this device.

A routing hint is a performance tuning option which can improve the performance of applications that use large collections. Ditto will make a best effort to co-locate data for the same routing key. In most circumstances, this should substantially improve responsiveness of the Ditto Cloud.

The value of the routing_hint routing hint is application specific - you are free to chose any value. Devices which you expect to operate on most of the same data should be configured to use the same value.

A routing hint does not partition data. The value of the routing hint will not affect the data returned for a query. The routing hint only improves the efficiency of the Cloud's ability to satisfy the query.

◆ sync_group

uint32_t ditto::Global::sync_group = 0

The sync group for this device.

When peer-to-peer transports are enabled, all devices with the same App ID will normally form an interconnected mesh network. In some situations it may be desirable to have distinct groups of devices within the same app, so that connections will only be formed within each group. The syncGroup parameter changes that group membership. A device can only ever be in one sync group, which by default is group 0. Up to 2^32 distinct group numbers can be used in an app.

This is an optimization, not a security control. If a connection is created manually, such as by specifying a connect transport, then devices from different sync groups will still sync as normal. If two groups of devices are intended to have access to different data sets, this must be enforced using Ditto's permissions system.