Skip to content

Switch from Realm to SQLite #132

@thehale

Description

@thehale

I initially chose Realm as the database persistence layer because it was the easiest to configure at the time.
Additionally, at the time, React Native was going through the transition to the new architecture, and I couldn't find any React Native SQLite libraries that appeared to have been updated to support the transition.

But now, Realm is no longer supported and will be removed in September 2025, so I have to find another solution.

Fortunately, some new SQLite libraries have been published in the meantime, so I can consider switching to one of them:

Personally, I'm leaning towards Nitro SQLite because it appears to have a nicer integration with TypeORM which I'm also leaning towards as the replacement for Realm's schema layer.


The switch will also have to consider data migration for existing users. Since Realm won't be available forever, I will probably have to host a service that can receive a Realm database and convert it to the latest SQLite schema version (or at least export to STIF format to be re-imported locally on-device).

Alternatively, if there's a way to run the Realm library locally in the app (even if it doesn't have the nice React Native integration), that would allow for a fully local conversion, saving all the time, expense, and complication of a cloud based migration.

Metadata

Metadata

Labels

mvpMinimum Viable Product

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions