Background Mass Storage Queries IOS

Good afternoon, I would like to ask a couple of questions regarding realm.

The first is about how a non-main thread can store data, for example background. I have thousands of records and in the main thread the app freezes.

The second is how can I get the data stored in background or another thread.

I am developing an application that receives more than 5000 records through an api and when trying to save them using the main thread, the app freezes. I tried many options to be able to store data in another thread and then be able to get it but I have not had good results. I can barely store the data, but when the realm instance gets it, it doesn’t get it.

I have an observation or curiosity. By doing the above procedure, I was checking the database with realm studio and the data is stored fine, but for some reason in the app, the query is not getting the updated data.

I would appreciate any input. Greetings.

Realm can easily handle tens of thousands (or more?) of objects with very little memory impact. If you’re code is freezing, “you’re probably doing it wrong”. So seeing the code of how/what you’re doing may reveal the issue. Having them “in the main thread” is concerning as that should not be the case.

That’s a small number of objects (there are no records in Realm, only objects). One of our projects has gigabytes of data and Realm sails through it.

Again, seeing some brief examples of what your doing code-wise, and where the issues lies may lead to a better understanding and some solutions.