diff --git a/source/includes/api-details/csharp/sync/pbs-open-synced-database-description.rst b/source/includes/api-details/csharp/sync/pbs-open-synced-database-description.rst new file mode 100644 index 0000000000..798dc4629f --- /dev/null +++ b/source/includes/api-details/csharp/sync/pbs-open-synced-database-description.rst @@ -0,0 +1,11 @@ +#. Create a + :dotnet-sdk:`PartitionSyncConfiguration ` + object that includes the :ref:`partition value ` and + the :dotnet-sdk:`User ` object. + +#. Open a synced database *asynchronously* by calling the + :dotnet-sdk:`GetInstanceAsync() ` + method, or *synchronously* with the :dotnet-sdk:`GetInstance() ` + method. Pass in the ``PartitionSyncConfiguration`` object. + +The following code demonstrates these steps: diff --git a/source/includes/api-details/csharp/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/csharp/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..ba6c022cff --- /dev/null +++ b/source/includes/api-details/csharp/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,16 @@ +.. procedure:: + + .. step:: Update the SyncConfiguration + + Change your + :dotnet-sdk:`PartitionSyncConfiguration ` + to a + :dotnet-sdk:`FlexibleSyncConfiguration `. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/api-details/java/sync/pbs-open-synced-database-java-description.rst b/source/includes/api-details/java/sync/pbs-open-synced-database-java-description.rst new file mode 100644 index 0000000000..baf9d8aab2 --- /dev/null +++ b/source/includes/api-details/java/sync/pbs-open-synced-database-java-description.rst @@ -0,0 +1,14 @@ +To configure settings for a database, create a +:java-sdk:`SyncConfiguration ` with a +:java-sdk:`SyncConfiguration.Builder `. + +The following example configures a synced database with: + +- Partition-Based Sync +- Synchronous reads explicitly allowed on the UI thread +- Synchronous writes explicitly allowed on the UI thread +- Explicit waiting for all backend changes to synchronize to the device + before returning an open database +- Automatic compaction when launching the database to save file space + +.. include:: /includes/java-synchronous-reads-writes-ui-thread-java.rst diff --git a/source/includes/api-details/java/sync/pbs-open-synced-database-kotlin-description.rst b/source/includes/api-details/java/sync/pbs-open-synced-database-kotlin-description.rst new file mode 100644 index 0000000000..fcd22c41c0 --- /dev/null +++ b/source/includes/api-details/java/sync/pbs-open-synced-database-kotlin-description.rst @@ -0,0 +1,14 @@ +To configure settings for a database, create a +:java-sdk:`SyncConfiguration ` with a +:java-sdk:`SyncConfiguration.Builder `. + +The following example configures a synced database with: + +- Partition-Based Sync +- Synchronous reads explicitly allowed on the UI thread +- Synchronous writes explicitly allowed on the UI thread +- Explicit waiting for all backend changes to synchronize to the device + before returning an open database +- Automatic compaction when launching the database to save file space + +.. include:: /includes/java-synchronous-reads-writes-ui-thread-kotlin.rst diff --git a/source/includes/api-details/java/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/java/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..115068dc0c --- /dev/null +++ b/source/includes/api-details/java/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,21 @@ +.. procedure:: + + .. step:: Update the SyncConfiguration + + Update your :java-sdk:`SyncConfiguration.Builder + ` to use + :ref:`Flexible Sync `. This involves + removing the ``partitionValue`` and adding a set of initial subscriptions, + if needed. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + Remove automatic Flexible Sync subscriptions. If you did not add initial + subscriptions in the ``SyncConfiguration.Builder``, manually create the + relevant subscriptions. + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/api-details/javascript/sync/pbs-open-synced-database-js-ts-description.rst b/source/includes/api-details/javascript/sync/pbs-open-synced-database-js-ts-description.rst new file mode 100644 index 0000000000..3480cd654b --- /dev/null +++ b/source/includes/api-details/javascript/sync/pbs-open-synced-database-js-ts-description.rst @@ -0,0 +1,7 @@ +To open a database with Partition-Based Sync, call +:js-sdk:`Realm.open() `. +Pass in a :js-sdk:`Configuration ` +object, which must include the ``sync`` property defining a +:js-sdk:`SyncConfiguration ` object. +In the ``SyncConfiguration``, you must include include ``user`` and +``partitionValue``. diff --git a/source/includes/api-details/javascript/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/javascript/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..e92fc4bde7 --- /dev/null +++ b/source/includes/api-details/javascript/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,15 @@ +.. procedure:: + + .. step:: Update the SyncConfiguration + + Add ``flexible:true`` to your + :js-sdk:`SyncConfiguration ` object + where you :ref:`open a synced database `. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/api-details/kotlin/sync/pbs-open-synced-database-description.rst b/source/includes/api-details/kotlin/sync/pbs-open-synced-database-description.rst new file mode 100644 index 0000000000..4d00e5b875 --- /dev/null +++ b/source/includes/api-details/kotlin/sync/pbs-open-synced-database-description.rst @@ -0,0 +1,7 @@ +To open a :ref:`Partition-Based Sync ` database, +pass a user, a partition, and a set of SDK object schemas to +:kotlin-sync-sdk:`SyncConfiguration.Builder() +`. +Then, pass the configuration to :kotlin-sdk:`Realm.open() +` to open +an instance of the database: diff --git a/source/includes/api-details/kotlin/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/kotlin/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..c724541e75 --- /dev/null +++ b/source/includes/api-details/kotlin/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,17 @@ +.. procedure:: + + .. step:: Update the SyncConfiguration + + Update your :kotlin-sync-sdk:`SyncConfiguration.Builder() + ` + to use Flexible Sync where you :ref:`open a synced database + `. This involves removing the + ``partitionValue`` and adding a set of initial subscriptions, if needed. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/api-details/objectivec/sync/pbs-open-synced-database-description.rst b/source/includes/api-details/objectivec/sync/pbs-open-synced-database-description.rst new file mode 100644 index 0000000000..1db2b70a09 --- /dev/null +++ b/source/includes/api-details/objectivec/sync/pbs-open-synced-database-description.rst @@ -0,0 +1,11 @@ +The first time you log in and open a synced database, log in the +user, and pass the user's :objc-sdk:`RLMSyncConfiguration +` +object with the desired :objc-sdk:`partitionValue +` +to :objc-sdk:`+[RLMRealm realmWithConfiguration:error:] +`. + +This opens a synced database on the device. The database +attempts to sync with your App in the background to check for changes +on the server, or upload changes that the user has made. diff --git a/source/includes/api-details/objectivec/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/objectivec/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..92c567135f --- /dev/null +++ b/source/includes/api-details/objectivec/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,16 @@ +.. procedure:: + + .. step:: Update the Sync Configuration + + Switch to a :objc-sdk:`RLMUser -flexibleSyncConfiguration + ` + where you :ref:`open a synced database + `. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/api-details/swift/sync/pbs-open-synced-database-description.rst b/source/includes/api-details/swift/sync/pbs-open-synced-database-description.rst new file mode 100644 index 0000000000..19545e7bde --- /dev/null +++ b/source/includes/api-details/swift/sync/pbs-open-synced-database-description.rst @@ -0,0 +1,9 @@ +Pass a logged-in user's :swift-sdk:`configuration ` +object with the desired :ref:`partition value ` to +:swift-sdk:`realm initializers +`. + +You can optionally :ref:`specify whether a database should download +changes before opening `. If you do not +specify download behavior, this opens a database with data that is on +the device, and attempts to sync changes in the background. diff --git a/source/includes/api-details/swift/sync/pbs-update-client-code-after-migration-procedure.rst b/source/includes/api-details/swift/sync/pbs-update-client-code-after-migration-procedure.rst new file mode 100644 index 0000000000..075f272abe --- /dev/null +++ b/source/includes/api-details/swift/sync/pbs-update-client-code-after-migration-procedure.rst @@ -0,0 +1,14 @@ +.. procedure:: + + .. step:: Update the Sync Configuration + + Switch to a ``flexibleSyncConfiguration()`` where you :ref:`open a synced + database `. + + .. step:: Add Properties to Object Models + + .. include:: /includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst + + .. step:: Remove Automatic Subscriptions and Manually Create New Ones + + .. include:: /includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst diff --git a/source/includes/java-open-synced-realm.rst b/source/includes/java-open-synced-realm.rst index 9799fb9202..d3febf4ff9 100644 --- a/source/includes/java-open-synced-realm.rst +++ b/source/includes/java-open-synced-realm.rst @@ -1,38 +1,17 @@ -To open a synced realm, call +To open a synced database, call :java-sdk:`getInstanceAsync() `, passing in a :java-sdk:`SyncConfiguration ` -object. The following code demonstrates how to create a realm with -specific sync settings created using a ``SyncConfiguration`` object: - -.. tabs-realm-languages:: - - .. tab:: - :tabid: kotlin - - .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.kt - :language: kotlin - :copyable: false +object. - .. tab:: - :tabid: java - - .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.java - :language: java - :copyable: false - -The code above shows how to open the realm *asynchronously* -by using :java-sdk:`getInstanceAsync() -`. -You can also open a realm synchronously by using :java-sdk:`getInstance() +You can also open a database synchronously by using :java-sdk:`getInstance() `, which -returns an open realm before synchronizing all data from the backend. +returns an open database before synchronizing all data from the backend. However, this may lead to temporary data inconsistencies while the remote data is downloaded, and is generally not recommended. You can use the :java-sdk:`waitForInitialRemoteData() ` configuration option to force the SDK to fetch remote data before -opening the realm to avoid these inconsistencies. +opening the database to avoid these inconsistencies. -The :ref:`partition value ` specifies which subset of your data to sync. -This is typically a user ID, project ID, store ID, or some other category identifier in -your app that has particular relevance to the current user. +The following code demonstrates how to create a database with +specific sync settings created using a ``SyncConfiguration`` object: diff --git a/source/includes/java-synchronous-reads-writes-ui-thread-java.rst b/source/includes/java-synchronous-reads-writes-ui-thread-java.rst new file mode 100644 index 0000000000..2c2f04d218 --- /dev/null +++ b/source/includes/java-synchronous-reads-writes-ui-thread-java.rst @@ -0,0 +1,21 @@ +.. important:: Synchronous Reads and Writes on the UI Thread + + By default, you can only read or write to a database in your + application's UI thread using asynchronous transactions. That is, + you can only use ``Realm`` methods whose name ends with the word + ``Async`` in the main thread of your Android application unless you + explicitly allow the use of synchronous methods. + + This restriction exists for the benefit of your application users: + performing read and write operations on the UI thread can lead to + unresponsive or slow UI interactions, so it's usually best to handle + these operations either asynchronously or in a background thread. + However, if your application requires the use of synchronous + database reads or writes on the UI thread, you can explicitly allow + the use of synchronous methods with the following + ``SyncConfiguration`` options: + +.. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.java + :language: java + :emphasize-lines: 2,3 + :copyable: false diff --git a/source/includes/java-synchronous-reads-writes-ui-thread-kotlin.rst b/source/includes/java-synchronous-reads-writes-ui-thread-kotlin.rst new file mode 100644 index 0000000000..41174f4bf6 --- /dev/null +++ b/source/includes/java-synchronous-reads-writes-ui-thread-kotlin.rst @@ -0,0 +1,21 @@ +.. important:: Synchronous Reads and Writes on the UI Thread + + By default, you can only read or write to a database in your + application's UI thread using asynchronous transactions. That is, + you can only use ``Realm`` methods whose name ends with the word + ``Async`` in the main thread of your Android application unless you + explicitly allow the use of synchronous methods. + + This restriction exists for the benefit of your application users: + performing read and write operations on the UI thread can lead to + unresponsive or slow UI interactions, so it's usually best to handle + these operations either asynchronously or in a background thread. + However, if your application requires the use of synchronous + database reads or writes on the UI thread, you can explicitly allow + the use of synchronous methods with the following + ``SyncConfiguration`` options: + +.. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.kt + :language: kotlin + :emphasize-lines: 2,3 + :copyable: false diff --git a/source/includes/java-synchronous-reads-writes-ui-thread.rst b/source/includes/java-synchronous-reads-writes-ui-thread.rst deleted file mode 100644 index b00d6c41cc..0000000000 --- a/source/includes/java-synchronous-reads-writes-ui-thread.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. important:: Synchronous Reads and Writes on the UI Thread - - By default, you can only read or write to a realm in your - application's UI thread using - :ref:`asynchronous transactions `. That is, - you can only use ``Realm`` methods whose name ends with the word - ``Async`` in the main thread of your Android application unless you - explicitly allow the use of synchronous methods. - - This restriction exists for the benefit of your application users: - performing read and write operations on the UI thread can lead to - unresponsive or slow UI interactions, so it's usually best to handle - these operations either asynchronously or in a background thread. - However, if your application requires the use of synchronous - realm reads or writes on the UI thread, you can explicitly allow - the use of synchronous methods with the following - ``SyncConfiguration`` options: - - .. tabs-realm-languages:: - - .. tab:: - :tabid: java - - .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.java - :language: java - :emphasize-lines: 2,3 - :copyable: false - - .. tab:: - :tabid: kotlin - - .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.allow-reads-writes-ui-thread.kt - :language: kotlin - :emphasize-lines: 2,3 - :copyable: false diff --git a/source/includes/note-writecopy-local-to-sync.rst b/source/includes/note-writecopy-local-to-sync.rst index 32e04aa2c6..54842c19a0 100644 --- a/source/includes/note-writecopy-local-to-sync.rst +++ b/source/includes/note-writecopy-local-to-sync.rst @@ -1,5 +1,6 @@ .. note:: Partition-Based Sync Only - This method only supports converting between a non-sync realm and + This method only supports converting between a non-sync database and Partition-Based Sync. If your app uses Flexible Sync, you must manually - iterate through the objects in one realm and copy them into the other realm. + iterate through the objects in one database and copy them into the other + database. diff --git a/source/includes/note-writecopy-same-type-sync-only.rst b/source/includes/note-writecopy-same-type-sync-only.rst index b001c8b878..88a02f4806 100644 --- a/source/includes/note-writecopy-same-type-sync-only.rst +++ b/source/includes/note-writecopy-same-type-sync-only.rst @@ -3,4 +3,4 @@ This method only supports copying a Partition-Based Sync configuration for another Partition-Based Sync user, or a Flexible Sync configuration for another Flexible Sync user. You cannot use this method to convert between a - Partition-Based Sync realm and a Flexible Sync realm or vice-versa. + Partition-Based Sync database and a Flexible Sync database or vice-versa. diff --git a/source/includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst b/source/includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst new file mode 100644 index 0000000000..c13df8c5f1 --- /dev/null +++ b/source/includes/pbs-to-fs-migration-add-relevant-properties-to-models.rst @@ -0,0 +1,3 @@ +Add relevant properties to your object models to use in your Flexible Sync +subscriptions. For example, you might add an ``ownerId`` property to enable +a user to sync only their own data. diff --git a/source/includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst b/source/includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst new file mode 100644 index 0000000000..861f97a29e --- /dev/null +++ b/source/includes/pbs-to-fs-migration-remove-and-add-subscriptions.rst @@ -0,0 +1,12 @@ +When you migrate from Partition-Based Sync to Flexible Sync, the SDK +automatically creates hidden Sync subscriptions for your app. The +next time you add or change subscriptions, we recommend that you: + +1. :ref:`Remove the automatically-generated subscriptions `. +2. :ref:`Manually add the relevant subscriptions in your client codebase `. + +This enables you to see all of your subscription logic together in your +codebase for future iteration and debugging. + +For more information about the automatically-generated Sync +subscriptions, refer to :ref:`realm-sync-migrate-client`. diff --git a/source/includes/sdk-examples/sync/pbs-open-synced-database.rst b/source/includes/sdk-examples/sync/pbs-open-synced-database.rst new file mode 100644 index 0000000000..45ad1a60ea --- /dev/null +++ b/source/includes/sdk-examples/sync/pbs-open-synced-database.rst @@ -0,0 +1,51 @@ +.. tabs-drivers:: + + tabs: + + - id: csharp + content: | + + .. literalinclude:: /examples/generated/dotnet/OpenARealmExamples.snippet.open-synced-realm.cs + :language: csharp + + - id: java + content: | + + .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.configure-a-realm.java + :language: java + + - id: java-kotlin + content: | + + .. literalinclude:: /examples/generated/java/sync/OpenARealmTest.snippet.configure-a-realm.kt + :language: kotlin + + - id: javascript + content: | + + .. literalinclude:: /examples/generated/node/open-and-close-a-realm.snippet.open-partition-based.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/SyncTest.snippet.open-a-synced-realm.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/generated/code/start/Sync.snippet.init-synced-realm.m + :language: objectivec + + - id: swift + content: | + + .. literalinclude:: /examples/generated/code/start/Sync.snippet.open-realm-partition-based-sync.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/generated/node/open-and-close-a-realm.snippet.open-partition-based.ts + :language: typescript diff --git a/source/sdk/model-data/change-object-model.txt b/source/sdk/model-data/change-object-model.txt index 5fd2bc4565..31a0b48759 100644 --- a/source/sdk/model-data/change-object-model.txt +++ b/source/sdk/model-data/change-object-model.txt @@ -10,4 +10,10 @@ Change an Object Model :depth: 2 :class: singlecol -Placeholder page for changing an object model. (Migrations) \ No newline at end of file +Placeholder page for changing an object model. (Migrations) + +.. _sdks-delete-a-property: + +Delete a Property +----------------- + diff --git a/source/sdk/sync/configure-and-open-synced-database.txt b/source/sdk/sync/configure-and-open-synced-database.txt index f2a178fbca..d073d7040d 100644 --- a/source/sdk/sync/configure-and-open-synced-database.txt +++ b/source/sdk/sync/configure-and-open-synced-database.txt @@ -19,3 +19,8 @@ Configure & Open a Synced Database :class: singlecol Placeholder page for configuring and opening a synced database. + +.. _sdks-download-changes-before-open: + +Download Changes Before Open +---------------------------- diff --git a/source/sdk/sync/manage-sync-sessions.txt b/source/sdk/sync/manage-sync-sessions.txt index 171c6c6366..49254167b0 100644 --- a/source/sdk/sync/manage-sync-sessions.txt +++ b/source/sdk/sync/manage-sync-sessions.txt @@ -19,3 +19,8 @@ Manage Sync Sessions :class: singlecol Placeholder page for information about managing sync sessions. + +.. _sdks-pause-resume-sync: + +Pause or Resume a Sync Session +------------------------------ diff --git a/source/sdk/sync/manage-sync-subscriptions.txt b/source/sdk/sync/manage-sync-subscriptions.txt index d3a3d1a42a..436c09a9a3 100644 --- a/source/sdk/sync/manage-sync-subscriptions.txt +++ b/source/sdk/sync/manage-sync-subscriptions.txt @@ -11,3 +11,13 @@ Manage Sync Subscriptions :class: singlecol Placeholder page for information about managing Flexible Sync subscriptions. + +.. _sdks-add-sync-subscriptions: + +Add Sync Subscriptions +---------------------- + +.. _sdks-remove-sync-subscriptions: + +Remove Sync Subscriptions +------------------------- diff --git a/source/sdk/sync/partition-based-sync.txt b/source/sdk/sync/partition-based-sync.txt index 7c91c8a1bf..bab26c8f1f 100644 --- a/source/sdk/sync/partition-based-sync.txt +++ b/source/sdk/sync/partition-based-sync.txt @@ -4,10 +4,199 @@ Partition-Based Sync ==================== +.. meta:: + :description: Learn how to migrate a Partition-Based Sync app to Flexible Sync, or open a database for Partition-Based Sync. + :keywords: Realm, .NET SDK, Kotlin SDK, Java SDK, Node.js SDK, Swift SDK, code example + +.. facet:: + :name: genre + :values: reference + +.. facet:: + :name: programming_language + :values: csharp, java, javascript/typescript, kotlin, objective-c, swift + .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol -Placeholder page for Partition-Based Sync content. +.. tabs-selector:: drivers + +Partition-Based Sync is a legacy mode for using Atlas Device Sync with Atlas +Device SDK. You can no longer create new Partition-Based Sync apps. All of the +Device Sync-related content on other pages in the SDK docs assume your app +uses the default Sync mode, Flexible Sync. + +This page covers how to migrate a Partition-Based Sync app to a Flexible Sync +app. For apps that still use Partition-Based Sync, this page also has details +for opening a database with Partition-Based Sync. + +.. tip:: C++ and Flutter SDKs Do Not Support Partition-Based Sync + + The examples on this page do not include details for C++ or Dart because + the C++ and Flutter SDKs have never supported Partition-Based Sync. + +.. _sdks-migrate-pbs-to-fs: + +Migrate from Partition-Based Sync to Flexible Sync +-------------------------------------------------- + +You can migrate your app from Partition-Based Sync mode +to Flexible Sync. Migrating is an automatic process that does not require +any changes to your application code. Automatic migration requires +the following minimum SDK versions: + +- .NET SDK v11.1.0 and later +- Java SDK v10.16.0 and later +- Kotlin SDK v1.9.0 and later +- Node.js SDK v11.10.0 and later +- Swift SDK v10.40.0 and later + +Migrating enables you to keep your existing App Services users and +authentication configuration. Flexible Sync provides more versatile permissions +configuration options and more granular data synchronization. + +For more information about how to migrate your App Services App from +Partition-Based Sync to Flexible Sync mode, refer to :ref:`Migrate Device Sync Modes +` in the App Services documentation. + +.. _sdks-update-client-code-after-pbs-to-fs-migration: + +Update Client Code After Migration +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The automatic migration from Partition-Based Sync to Flexible Sync does not +require any changes to your client code. However, to support this +functionality, the SDK automatically handles the differences between the two +Sync Modes by: + +- Automatically creating Sync subscriptions for each object type + where ``partitionKey == partitionValue``. +- Injecting a ``partitionKey`` field into every object if one does not already + exist. This is required for the automatic Sync subscription. + +If you need to make updates to your client code after migration, consider +updating your client codebase to remove this hidden migration functionality. + +You might want update your client codebase when: + +- You add a new model or change a model in your client codebase. +- You add or change functionality that involves reading or writing SDK objects. +- You want to implement more fine-grained control over what data you sync. + +Convert Partition-Based Sync Client Code to Use Flexible Sync +````````````````````````````````````````````````````````````` + +Make these changes to convert your Partition-Based Sync client code to use +Flexible Sync: + +.. tabs-drivers:: + + .. tab:: + :tabid: csharp + + .. include:: /includes/api-details/csharp/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: java + + .. include:: /includes/api-details/java/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: java-kotlin + + .. include:: /includes/api-details/java/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: javascript + + .. include:: /includes/api-details/javascript/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: kotlin + + .. include:: /includes/api-details/kotlin/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: objectivec + + .. include:: /includes/api-details/objectivec/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: swift + + .. include:: /includes/api-details/swift/sync/pbs-update-client-code-after-migration-procedure.rst + + .. tab:: + :tabid: typescript + + .. include:: /includes/api-details/javascript/sync/pbs-update-client-code-after-migration-procedure.rst + +For examples of Flexible Sync permissions strategies, including examples of +how to model data for these strategies, refer to the :ref:`flexible-sync-permissions-guide` +in the App Services documentation. + +.. _sdks-pbs-open-synced-database: + +Open a Synced Database with Partition-Based Sync +------------------------------------------------ + +You can open a synced database for Partition-Based Sync by passing the +appropriate partition value in the Sync configuration. + +.. tip:: Partition Value + + For App Services Apps that use Partition-Based Sync, your client + implementation must include a partition value. This is the value of the + :ref:`partition key ` field in the Partition-Based Sync + configuration. + + The partition value determines which data the client application can access. + + You pass in the partition value when you open a synced database. + +.. tabs-drivers:: + + .. tab:: + :tabid: csharp + + .. include:: /includes/api-details/csharp/sync/pbs-open-synced-database-description.rst + + .. tab:: + :tabid: java + + .. include:: /includes/api-details/java/sync/pbs-open-synced-database-java-description.rst + + .. tab:: + :tabid: java-kotlin + + .. include:: /includes/api-details/java/sync/pbs-open-synced-database-kotlin-description.rst + + .. tab:: + :tabid: javascript + + .. include:: /includes/api-details/javascript/sync/pbs-open-synced-database-js-ts-description.rst + + .. tab:: + :tabid: kotlin + + .. include:: /includes/api-details/kotlin/sync/pbs-open-synced-database-description.rst + + .. tab:: + :tabid: objectivec + + .. include:: /includes/api-details/objectivec/sync/pbs-open-synced-database-description.rst + + .. tab:: + :tabid: swift + + .. include:: /includes/api-details/swift/sync/pbs-open-synced-database-description.rst + + .. tab:: + :tabid: typescript + + .. include:: /includes/api-details/javascript/sync/pbs-open-synced-database-js-ts-description.rst + +.. include:: /includes/sdk-examples/sync/pbs-open-synced-database.rst diff --git a/source/sdk/users/authenticate-users.txt b/source/sdk/users/authenticate-users.txt index 4b334a24b2..dc83c98b78 100644 --- a/source/sdk/users/authenticate-users.txt +++ b/source/sdk/users/authenticate-users.txt @@ -11,3 +11,13 @@ Authenticate Users :class: singlecol Placeholder page for authenticate users content. + +.. _sdks-offline-login: + +Offline Login +------------- + +.. _sdks-refresh-token-expiry: + +Refresh Token Expiration +------------------------