C# Release Notes
4.10.0 New Capabilities
Small Peer User Collection Sync Scopes
User Collection Sync Scopes let you control how data from each user collection is shared with other connected Peers. This is useful when you want to fine-tune which collections do not sync, which collections sync with only the cloud (Big Peer) and which collections sync only with connected Small Peer devices.
Sync scopes can be used to control how documents sync, reduce unnecessary data transfer, and improve performance.
SDK>Configuring Collection Sync
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. For more information
see Updating Sync Scopes
Details
Sync Scope | Purpose |
---|---|
”AllPeers” (default) | Sync with both the Big Peer and other Small Peers. This is the default behavior for all collections. |
”BigPeerOnly” | Sync only with the Big Peer. Do no sync with other Small Peers. |
”SmallPeersOnly” | Sync only with other Small Peers. Do not sync with the Big Peer. |
”LocalPeerOnly” | Do not sync this collection to the Big Peer or other Small Peers. |
DQL Syntax for setting a Sync Scope
Example Setting A Sync Scope in the SDKs
In the example below we’ll set the collection local_mesh_orders
to only sync with other small peers in the mesh and not with the Big Peer using the SmallPeersOnly
sync scope.
Store Observers Run Multi-Threaded By Default
Ditto store observers (e.g ditto.store.registerObserver(...)
) will now run multi-threaded on all platforms (except for in Web Browsers)
by default. Prior to 4.10.0
all store observers would run on the same thread which could lead to performance issues for applications
with multiple store observers. Users may see performance improvements on applications using more than one store observer, especially during
high-volume usage.
Ditto guarantees order sequencing for a single observer. Because observers now run in parallel there is not a guarantee for order sequencing between observers. This behavior change should not have an impact on your application. If you have concerns or questions about this behavior change reach out to Ditto’s Customer Support.
To reset Ditto to only use a single thread for all Ditto observers use the following system parameter. For instruction on how to set
a system parameter in your specific SDK see SDK>Customizing System Settings
DQL Support for LIKE
operator
The LIKE
operator can now be used for pattern matching of string values.
DQL>Operator Expressions
Pattern | Meaning |
---|---|
% | Matches zero or more characters (like .* in regex) |
_ | Matches exactly one character (like . in regex) |
Example
DQL New Objects operators
DQL now supports two new methods for querying over the keys and values in an object.
object_keys(object)
: Returns anarray
with all the keys in the givenobject
.object_values(object)
: Returns anarray
with all the values inobject
.
DQL>Operator Expressions
DQL LIMIT/ OFFSET / ORDER BY support for mutation operators
Users can now use LIMIT
, OFFSET
and ORDER BY
in EVICT
and UPDATE
statements.
DQL Example