How to pin an entire database? (iOS SDK)

Is there a trick/way or a design pattern that is recommended for downloading and pinning all records from a database (Parse app) on first launch of a mobile app? (iOS / Swift)

It’s not a large database, total < 2000 records. 5 classes. Hub/spoke relationship from 1 class to the other 4 classes. No media. No special security - all users are reader.

I’ve cooked up my own method that performs an all records search against each class and pins the results. It seems to work well but I wondered if there was a design pattern that was promoted for this scenario.

Thanks in advance.

I dont recommend local databse of parse. Parse work fast online. But local database is so slow. I recommend you to use local sql dabase. Google has a library for android called “Room” But I dont know about Ios developing. I believe there is an alternative for Ios.

I hear what you’re saying but I’m not keen to add another library to the app, and, I’m sure the quantity of data is fairly small so I don’t think performance will be an issue.

Thinking more about this…

So lets say I were to consider using an alternative local database. Which one do people recommend? And how do I synchronise data between Parse and the local store?

In the past I have written a Parse <=> Realm sync and while for the most part it did work to be honest it was horrible. Each time I’d resolve bugs with an edge case I’d find 2 more edge cases requiring special treatment. I’m not aware of a sync library from Parse to anything.

So the question is. Is there a reliable method of syncing data from Parse on the server to a local iOS data store?

I’d say that local data store works pretty well for small datasets but I wouldn’t rely on it pinning an entire dB.

I’m not aware of any reliable solutions to use the iOS SDK with something like realm or core data for local storage although I have seen some code snippet of people attempting to make the SDK codable for use with core data.

Thanks Tom. I feel a lot of testing coming my way. :slight_smile: