Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 65816
Original poster
Oct 14, 2013
1,444
293
As many of us time is limited. Sometimes I need more time to grasp concepts. This requires me to limit the number of technologies I am willing to learn. Especially as it isn't my goal to land a job but create some own apps.

So I would like to ask your recommendation on databases. I saw that apple introduced NSPersistentCloudKitContainer at WWDC2019 which syncs with CoreData. I did however get the impression that it aims at syncing for instance the photos of one person over several devices but wouldn't be interesting to create the reservations at a restaurant? Is this correct?

Then server side swift seemed interesting with vapor for instance. This would have the plus you could run your own MySQL or mongoDB with swift classes, probably on your own hosting server. Problem is that you would not a persistent local store. So you would have to sync a CoreData or Realm or so with that server through something like icecream.

As realm is open source I could go all in with realm but it might disappear one day. Plus I read that some functionality doesn't come free?

Of course you have BAAS like FireStore which can become expensive and may wind up like Parse one day.

So price, life expectancy, speed, multiple platforms (maybe only apple platforms?), complexity all come into the equation. I would recommend your insights
 

atmenterprises

macrumors 6502
Jan 28, 2006
389
204
CoreData isn't a database. It's a way to save state quickly.

Have you considered SQLite? Been used in iPhone apps for years.
 

Mascots

macrumors 68000
Sep 5, 2009
1,663
1,413
Agree with the above: Core Data isn't a database in the sense that its purpose isn't storage. It's an object graph that can be persisted to a file based storage, but those records can't be accessed outside of the CD's object graph reliably. See The differences between Core Data and a Database, it's a really good read.

That's not to say that it doesn't have it's purpose, especially in iOS applications. I particularly love it for managing state. But every new project you approach, you're going to need to tailor your efforts to match the projects needs.

Core Data or SQLite (with GRDB.swift) are my go-tos for managing data on device, but the usages of each depends on what I'm doing.
 
Last edited:

grandM

macrumors 65816
Original poster
Oct 14, 2013
1,444
293
CoreData isn't a database. It's a way to save state quickly.

Have you considered SQLite? Been used in iPhone apps for years.
Agree with the above: Core Data isn't a database in the sense that its purpose isn't storage. It's an object graph that can be persisted to a file based storage, but those records can't be accessed outside of the CD's object graph reliably. See The differences between Core Data and a Database, it's a really good read.

That's not to say that it doesn't have it's purpose, especially in iOS applications. I particularly love it for managing state. But every new project you approach, you're going to need to tailor your efforts to match the projects needs.

Core Data or SQLite (with GRDB.swift) are my go-tos for managing data on device, but the usages of each depends on what I'm doing.
But how do you sync with the cloud?
 

Mascots

macrumors 68000
Sep 5, 2009
1,663
1,413
There's not really a one sized fit all solution out there. Syncing to the cloud is pretty vague: What's the goal? To share information between parties? To sync a user's app on multiple devices? To sync to some external network? All of these situations would be handled differently and require more than just a single system, imo.
 

grandM

macrumors 65816
Original poster
Oct 14, 2013
1,444
293
There's not really a one sized fit all solution out there. Syncing to the cloud is pretty vague: What's the goal? To share information between parties? To sync a user's app on multiple devices? To sync to some external network? All of these situations would be handled differently and require more than just a single system, imo.
True
I was thinking of apps sharing data amongst several users
If it were only one user I'd use the new NSCloudkitPersistentStore + CoreData
 

DaveBerry

macrumors newbie
May 27, 2019
13
4
UK, Yorkshire
If you want to share data among users you are looks at requiring a server application with exposed Api endpoints. These are typically written in Java, Php, .Net, Node etc.

I do believe you can have an application wide coredata storage solution, not just per user but I imagine this is only suitable for very limited use cases.
 

grandM

macrumors 65816
Original poster
Oct 14, 2013
1,444
293
Say you were coding a school app for different schools. This app should contain all pupils of that school. Staff of school A should be able to read/write data of school A. The staff members of school A are not sharing an account. Same for school B, C and so on.

Staff members data should be updated for all when a student's data changes. As sometimes wifi drops out you want it to have local storage so a teacher can enter grades anyhow. When there is an internet connection, for instance at home, the data needs to be synced.

You do not intend to launch a different app for each school, but just one app in the store.

What solution would suit?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.