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.
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?
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?
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?