realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

Uploading and Downloading Realm from a cloud database

Open wanclem opened this issue 10 years ago • 4 comments

So my use case is that I want to upload a user's realm, used as the database for a chat app to a cloud database and download it later for use as the default realm for a user whenever he/she switches log In device so he doesn't miss his messages...I.e Whenever user logs into app,users last realm(user.realm) is downloaded from a cloud store(if available) and used as the default realm,else create a new realm using(user.realm)....How can I achieve this? Thanks...

wanclem avatar Jun 16 '16 20:06 wanclem

Hi @WanClem

Here's a series of articles regarding your use case. Hope this helps.

stk1m1 avatar Jun 17 '16 01:06 stk1m1

Personally I would recommend against this approach because migrations will give you a massive headache, I'd just store a JSON on the server side and then recreate the Realm based on that.

Zhuinden avatar Jun 17 '16 04:06 Zhuinden

@Zhuinden

I agree with on migration issue. It would cause a headache, but regarding his use case, it seems to be a valid option for now.

stk1m1 avatar Jun 17 '16 10:06 stk1m1

Cool..

wanclem avatar Jun 17 '16 11:06 wanclem