Moving users from Realm Cloud to Self-Hosted

cloud
ros

#1

I have been trying out Realm Cloud and it is truly awesome! Great work guys!.

I am convinced that the Realm Cloud is the correct solution to get started, but in the future it could possibly make sense to migrate to a self-hosted version. How is this supposed to be done?

Switching between two self-hosted versions, for example when switching cloud providers would be done like this:
1: Setup the Realm Object Server on your new server and install your SSL certificates
2: Backup and stop your old server
3: Restore the backup on the new server and start
4: Point your dns records for the sync server to the new instance.
5: Done! :slight_smile:

But when moving from Cloud to Self-hosted, how would you recommend to set this up? As I understand I point my users to my realm cloud instance https://myaweseomeapp.us1.cloud.realm.io and I should be good to go. But if I later on want to move my users from cloud to my own instance, I would have to change the url my clients connect to?

I have thought about using Remote Config for the sync URL and also forcing the users to update, but none of those options seem bullet proof. Or will there be a possibility to install your own SSL certificates in Realm Cloud in the future? To be able to use your own hostname/dns?


#2

@Sipe You would need to update your app to now point to a new Realm Server DNS. Adding custom DNS or SSL is not currently on the roadmap but could be with enough demand.


#3

But wouldn’t that mean it is impossible to migrate users to a self hosted version without the risk of data loss?

Or can you update dns records to point to my self-hosted version? Not sure I understand how this is supposed to work.


#4

@Sipe Why would there be data loss?


#5

Maybe I am missing something, but I don’t understand how migration from realm cloud to a self hosted version would be possible without being able to change the dns records. Let’s consider the following scenario.

1: I am using Realm Cloud in production and want to move to a self hosted version.
2: I set up the new server
3: I move the data over to my new server and stop the realm cloud instance
4: I release a new update pointing y clients to the new server.

What happens to the clients that doesn’t update straight away? They would still be configured towards the old endpoint and thus their sync won’t work until they update. Not all users update immediately, and even if they do update the same day, they will have a period when they have the wrong endpoint. And what happens when if I change it after I drop support for an OS version? Then affected users will never get the new endpoint.

One way to get around this might be to use a remote config for the endpoint url. But the pricing page of realm platform says it is easy to migrate between realm cloud and self hosted if you can’t decide, so I kind of expected there to be a recommended path to do the switch.


#6

@Sipe Couldn’t you point use your own DNS and have it as a CNAME like myapp.sipe.com that points to Realm Cloud and then when you want to switch, you update the DNS record to your self-hosted ROS?

We would recommend releasing an update before you make the ROS URL change such as an alert controller pop-up that would force a user to upgrade to the latest version (the one with the new URL). You should also add a Client Reset callback that would allow you to save any un-synced data so that you can recover when the switch over happens.

In the future we have discussed adding a more automated approach but there hasn’t been any real demand for this right now so we have directed our resources elsewhere. This will change when people are ready to actually do this.


#7

No, because your SSL certificate doesn’t match my domain.

Also, a forced update approach is not a good one. For one, it means that I could never drop support for an iOS or Android version. Second, I would have to release the update exactly the same time for all my users on both iOS and Android.

I think a better approach would be to use remote configuration for the endpoint. That way I could switch the endpoint without forcing users to update. Plus it would take effect immediately on all clients.

I think I might be able to get by using this approach. Now, I understand this is not a priority, but I think it a bit misleading to state that it is easy to migrate on the pricing page. It is not :wink:

Sorry if I sound negative here. The Realm platform is a truly amazing platform and I want to get on it asap. I was just hoping to be able to start of with Realm Cloud and migrate later if I needed to. But now I think I have to think very carefully before making the decision.


#8

Good point on the certificate - that would not work. I think a remote config is a good option here.

Having your own cert or a redirect to your own server are features we could add to make this easy from the cloud side - but no one has wanted to do it yet so we have not built it.


#9

@ianward Is there a way to trigger the Client Reset Callback when using Realm Cloud? I want to make sure that I handle errors correctly before going to production.


#10

You can delete the Realm from Studio - that should trigger a client reset next time it’s opened.


#11

This is a good post of cloud service which is a remote config for sync URL and any user can get many options to work on SSL certification. You have mentioned all thing in an easy way and also they can get help from Icloud support for any kind of self hosted related issue