Realm Sync - Long Initial Download Times

I have a macOS app built with the Realm Swift SDK. The dataset is about 150mb and is running on an M2.

When a new user runs the app for the first time, the initial download of of the database takes FOREVER. It pushes 5 minutes, even on a 1000Mbps connection. Sync operations after the initial download are instant and perfect.

Restructuring/segmenting the database is not an option; the app requires all of the data that is being downloaded.

The initial-download performance is becoming untenable and I need advice on how to fix it. I found an old thread about compaction, here: MongoDB Realm syncing size - #13 by Brock_GL

It’s unclear if this advice is still relevant. Do I need to contact support to enable this, still? Or is the option now exposed in settings somewhere?

Hi Bryan,
Would you be willing to share your app ID? This will allow us to take a closer look and possibly determine if this is due to cluster limitations, network, or something else.

Sure. What’s the best way for me to get that to you in a non-public forum?

I sent you a DM, we can coordinate there.

Hi,
I have exactly the same issue

Do you have any solution for it please ? We are obliged to uninstall every day the app

Thank you

Hi, this is often very dependent on your application (object size, bootstrap size, cluster size, etc). Can you send a link to your application (realm cloud URL) and we can poke in and see if anything stands out?

Best,
Tyler

Hi Tyler,
Thank you for your reply et sorry for my late reply

How can I send you the link ?

Sorry I was with the wrong account … Can you give me DM again please
My bad :blush:

Hi,
I need the DM on this account Laurent_RIPOCHE, the other one is an account created by error :frowning:

Thank you a lot !

Hi, you should be able to just DM me directly. Also, the URL in the realm URL should not be considered sensitive information as only you and MongoDB employees are able to view it

Hi, I took a look at your app, and unfortunately I might need some more information from you. From my perspective, things look pretty good. In the past 10 days there have only been 27 bootstraps (clients connecting for the first time)

Minimum Time: 315 ms
Maximum Time: 564 ms
Average Time: 429 ms
P95 Time: 545 ms

This is the time it takes between receiving a connection from the client and sending the last of the download messages to the client. It is worth noting that the bootstraps themselves are not very large, so I wouldn’t expect there to be much time taken by the client to receive these changes and integrate them, but that part is not information collected by the server.

Can you elaborate on what exactly is slow? And do you have a specific user / request_id from the logs that you are looking at?

Best,
Tyler

Hi,
Thank you for your answer

The apps stuck like 5 minutes or more at the loading screen

The loading screen say that 100 % is downloaded and stay stuck for a long time and then go to the new view
(I’ve made a screenshot)

It’s so long that we preferer to uninstall it and resintall. But it’s not a long term solution :confused:

I’ ve used the starter template for SwiftUI

The second weird part is that my database is only like 20MB and take 18 GB of disk space

Thank you a lot !
Have a nice day

Hi, this seems like something that is most likely an issue with the code used to open the realm and use it (and most likely blocking the main thread on something that is not happening). Can you share the code you are using for this?

Best,
Tyler

Hi Tyler,
Hope you are well
I’ve sent you the sample of my code, did you receive it ?

Have a nice day

Do you have an estimate for how much data is being synced down here? We do not have logging for this (though we should, and I can add that soon)

I don’t know,
How can i find this information ?

Any clue for thie second issue :

The second weird part is that my database is only like 20MB and take 18 GB of disk space

thank you

You client device logs should show how much data is being sent to the client. You can post those logs here if possible?

As for the second, are you talking about realm or MongoDB?

Thank you for your fast reply,
I’ve sent you a dm with the log

As for the second, are you talking about realm or MongoDB?
MongoDB but we think that his realm who take the place

Hello Tyler

Did you receive the logs ?

Thank you for your help :slight_smile: