I have an app that use Realm-Java
That app follow Clean Archi with repository pattern on the data layer, meaning that “domain” and “presentation” doesn’t know about Realm.
The Android context of the repositories / data layer is application, so the lifecycle is the app (at least to keep the example simple)
I use the rx realm wrapper for almost every observation request / queries R_ (of CRUD)
Every update is done in the imperative manner C_UD (of CRUD)
I have for now a bit more that 10 repo, and can probably have up to 100, when everything will be done with realm.
Every C_UD operation get realm by "Realm.getDefaultInstance().use { … }
Every R_ operation are rx, and subscribe on a dedicated looper and a dedicated realm instance (one by repo)
Should I continue like that ? one looper + one realm instance by repo, and should I have a single one for the whole app ?
What are the best practices in that case ?