Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
SDK de C++

Sincronizar datos entre dispositivos - C++ SDK

Atlas Device Sync sincroniza automáticamente los datos entre las aplicaciones cliente y un Servicios deaplicaciones backend. Cuando un dispositivo cliente está en línea, Sync sincroniza asincrónicamente los datos en un hilo en segundo plano entre el dispositivo y la aplicación backend.

When you use Sync in your client application, your implementation must match the Sync Mode you select in your backend App configuration. The Realm C++ SDK only supports Flexible Sync.

Tip

Al seleccionar la Sincronización Flexible para la configuración de la aplicación backend, la implementación del cliente debe incluir suscripciones a consultas en campos consultables. La Sincronización Flexible funciona sincronizando los datos que coinciden con las suscripciones a consultas que mantiene en la aplicación cliente.

Un conjunto de suscripciones contiene un conjunto de consultas. Flexible Sync devuelve los documentos que coinciden con dichas consultas, siempre que el usuario tenga los permisos necesarios para leerlos o escribirlos. Si los documentos coinciden con la consulta, pero el cliente no tiene permiso para leerlos o escribirlos, no se sincronizan con la aplicación cliente.

You can form queries using Realm Query Language.

Nota

Flexible Sync no admite todos los operadores del query disponibles en el Realm Query Language y el motor de queries de los SDK. Consulta Limitaciones de Flexible Sync RQL para más detalles.

Subscription sets are based on a specific type of Realm object. You might have multiple subscriptions if you have many types of Realm objects.

To use Device Sync in your client application, open a synced realm with a Flexible Sync configuration. Then, manage subscriptions to determine which documents to sync. For more information, refer to Manage Sync Subscriptions - C++ SDK.

Every write transaction for a subscription set has a performance cost. If you need to make multiple updates to a Realm object during a session, consider keeping edited objects in memory until all changes are complete. This improves sync performance by only writing the complete and updated object to your realm instead of every change.

Device Sync supports the ability to send data to Atlas, but not receive any updates.

In this scenario, you can maximize sync performance by using Data Ingest to stream data from the client application to a Flexible Sync-enabled Atlas App Services App.

Volver

Custom User Data

En esta página