Do I need paging when I call a lot of data on Realm?


I’m developing an app using Realm.

I would like to ask you how to call up a lot of data.

In my past experience, when I sent the list format data from the server, I divided them into 10 and gave them to the app.

I’m making an app that only uses Realm without a server. Do I have to load data by dividing Realm data into 10 pieces??

This is from a performance point of view, not a UI/UX point of view.

In summary, Realm has no problem if it fetches a large number of data at once without paging??

No! That’s called “pagination” and is a very important tool to use when working with data that’s persisted in memory - for example what would be loaded from a Firebase database.

Realm is different. Realm objects are lazy-loaded, meaning thousands of objects would only occupy a small amount of memory. They only fully load when they are accessed.

There are caveats to this though; using Realm Collections is how that works but if those collections are mapped to a Swift Array, for example, all of the objects are loaded. Likewise, using high level Swift functions like Map, Reduce and Filter also cause them to load.

There are Realm counterparts to those functions for the most part that keeps data manageable and allows the developer to not worry about pagination or memory related issues when dealing with large datasets.

More info: see this Stackoverflow question and my answer . And maybe this answer and maybe this one too. Oh. here