Stream Data to Atlas - C++ SDK Preview
On this page
You can use Data Ingest to stream data from the client application to a Flexible Sync-enabled Atlas App Services App.
You might want to sync data unidirectionally in IoT applications, such as a weather sensor sending data to the cloud. Data Ingest is also useful for writing other types of immutable data where you do not require conflict resolution, such as creating invoices from a retail app or logging application events.
Data Ingest is optimized to provide performance improvements for heavy client-side insert-only workloads.
Sync Data Unidirectionally from a Client Application
Connect and Authenticate with an App Services App
To stream data from the client to your backend App, you must connect to an App Services backend and authenticate a user.
Changed in version 0.2.0: app.login returns std::future instead of std::promise
Changed in version v0.4.0-preview: Replaces deprecated realm::App(...) with realm::App(const realm::App::configuration&)
auto app = realm::App(APP_ID); auto user = app.login(realm::App::credentials::anonymous()).get();
Open a Realm
Tip
Mixed Object and Asymmetric Object Types
You cannot read, query, or delete an asymmetric_object
from a
realm, so asymmetric objects are incompatible with bi-directional
Flexible Sync or local realm use. You cannot open a single synced
realm to manage both regular objects and asymmetric objects - you
must use different realms to manage these different object types.
Create Asymmetric Objects
Once you have an open realm, you can create an asymmetric_object
and set its values as you would a regular object. However, you cannot
read or delete these objects. Once created, they sync to the App
Services backend and the linked Atlas database.
Atlas Device Sync completely manages the lifecycle of this data. It is maintained on the device until Data Ingest synchronization is complete, and then removed from the device.