Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-487

Discussion: Introduce SyncedRealm and Realm

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • Labels:
      None

      Currently in the Java SDK, and all other SDK's. We have a single Realm which is used for both synced and local databases.

      The reason for this is probably mostly historic, as local Realms was the only thing that existed in the beginning and served as the main entry point into all our API's.

      However, it also causes a few issues:

      • Synced Realms have different capabilities than local Realms, e.g. they also have a session and subscriptions property.
      • As we are shipping two libraries on Android, due to size concerns, it becomes cumbersome to inject the extra sync functionality.
      • Using extension methods on the Realm type is not type-safe, i.e. these methods also become available for local Realms, and throw if called.

      So the big question is: Should we introduce SyncedRealm as a public type alongside Realm?

      It has the advantage that the type system becomes safer and easier to manage in our internal code. The downside is that it is going to be different from all other SDK's and will increase the public API surface.

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: