Can I use realm (local) as temp database?

Hi smart developers,

I want to ask if I can use “realm” as a temp database (locally) then after some trigger from a user, all data from the temp database (realm local) will transfer to the “atlas” database (cloud) directly or by “realm sync”. is that possible in android (java)? I mean I read how to implement the realm as local (https://docs.mongodb.com/realm/sdk/android/quick-start-local/) and how to implement the sync but I did not get in how to implement both of them at the same time or use temp database.

I read also how to “Convert a Local Realm to a Synced Realm”
(Convert a Local Realm to a Synced Realm - Realm Sync (LEGACY)) but I did not understand it very well because I’m still a beginner.

any help?

Hello @lo0olo0o2412_N_A,

I acknowledge the age of the question and I hope you were able to find a solution to this.

but I did not get in how to implement both of them at the same time or use temp database

For others, trying to implement similar functionality, the recommended approach is to define synced (using SyncConfiguration) and local realm (using Configuration) separately using respective APIs.

The detailed information can be found in the following posts

  1. Open synced local database when completely offline - #4 by Sujeevan_Kuganesan
  2. Local Realm open after synchronized on realm cloud - #22 by nirinchev

I read also how to “Convert a Local Realm to a Synced Realm

This is in reference to Realm Cloud Legacy which has approached EOL on Nov 1, 2021.

For MongoDB Realm, please refer Add Sync to a local-only App section in the MongoDB Realm docs

1 Like