Sync Scope | Purpose |
---|---|
"AllPeers" (default) | Sync with both Ditto Server and other Small Peers. This is the default behavior for all collections. |
"BigPeerOnly" | Sync only with Ditto Server. Do not sync with other Small Peers. |
"SmallPeersOnly" | Sync only with other Small Peers. Do not sync with Ditto Server. |
"LocalPeerOnly" | Do not sync this collection to Ditto Server or other Small Peers. |
ALTER SYSTEM
operation to set the USER_COLLECTION_SYNC_SCOPES
system
property. This property takes a map where each key is a collection name and the value is the desired sync
scope.
ALTER SYSTEM
configurations reset with each Ditto initialization. To maintain your settings, apply them after every
new Ditto instance initialization. For more details, see Advanced>Customizing System Settings
.local_mesh_orders
to only sync with other small peers in the mesh and not with Ditto Server
using the SmallPeersOnly
sync scope.
ALTER SYSTEM USER_COLLECTION_SYNC_SCOPES
must be called before startSync()
to ensure data is not unintentionally synced.SHOW
command with the USER_COLLECTION_SYNC_SCOPES
system property.
startSync()
is called USER_COLLECTION_SYNC_SCOPES
cannot be updated without
closing and reopening a new Ditto instance. This will be resolved in the next release. ditto.close() or ditto = nil
ditto = Ditto(...)
ALTER SYSTEM
ditto.startSync()
to resume syncing with the new sync scopes.USER_COLLECTION_SYNC_SCOPES
is reset when the Ditto instance is closed.USER_COLLECTION_SYNC_SCOPES
after creating a new Ditto instance.USER_COLLECTION_SYNC_SCOPES
before calling startSync()
.SmallPeersOnly
sync scope. If any peer in the mesh does not set this
that peer will send data to Ditto Server.__
. Updating
USER_COLLECTION_SYNC_SCOPES
with a system collection will fail.LocalPeerOnly
, you ensure the data never leaves the device.