-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Sync
-
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.