I would like to create a utility class for Realm for my application, keeping most of the complexity with Realm in this class. To make life easier I proposed when opening a Realm instance I open all schemas within the app. As shown below:
export default class RealmAccess { private realm!: Realm; private allSchemas = [OneSchema, TwoSchema, ThreeSchema ... ]; private async open(schemaList: ObjectSchema[] = this.allSchemas): Promise<void> { this.realm = await open({ schema: schemaList }); }}
Would this be considered bad practice?
Would this affect app performance at all when fetching/saving data? As an example we can assume each schema has a minimum of 500 rows.
I can't seem to find anything in the docs about this.