How do I want to store my data?

Hi all!

I am pretty new to development in swift and am excited to master this language along with the Xcode utility. I am writing an app for my local gym and through this I need to store information. I need to capture, "lastName, firstName, DOB, gender etc… " and store it. The data will be immutable once stored however will need to be able to call to it later on within the app. Such as “View Female or Male competitors”. and have the data sort accordingly.

My challenge so far has been how I want to store the data within the app. I have tossed around Arrays, Dicts, Structs and even looked through some videos on Core Data. The gym has around 700 members and traditionally only 150-200 people take part in these challenges, so my data pool won’t be overwhelming, however each collection of data will include 3 images.

Any thoughts on how I should model the data management I would appreciate. I am going to dig through the core data course today along with the data persistence.

Thanks all!

Jay

Hi @jorndorff,
What have you found after you went through the videos/articles on all options? Which one suits your purpose best?

Arrays, Dicts and Structs are useful in the application to hold the data in memory, these are lost the moment you exit the app.

What you need is to persist the data and options for that are as simple as using UserDefaults, writing a text file, writing a JSON file, using a sqlite database or using CoreData

However the thing that I am confused about is what do you want to do, I think you also need a server that has all of the participants and each can download data either their own or all of the contestants, that is when you will use an array of structs to hold the data in memory.

if you share more info, you can get a better response to your question

cheers,

Thanks for the response Jay,

It makes sense now after doing a bunch of reading on data persistence. There is a course here for data persistence which I read through, however it was a higher level than I was ready for.

I am practicing now with all of the fundamentals to solidify what I have learned. From there I will explore the data persistence again and get some data put out to a file.

I am going to upgrade in a week or so to the beginner-pro so I have access to the books.

When you reference a server that holds the data. Can I store the db on the iPad itself or should I attempt to create a db storage on a web server? What I am really looking to do is collect data - (name-dob-gender-email-worksWithTrainer) along with 3 images-(front-side-back), from here I need to store the data to a point where I can call it back when “Voters” vote for the contestant they think did the best, so I will need to be able to call up by gender and list them for people to browse through and vote.

In addition to that I was looking to email the pics and basic data to an email so the Manager can print them out etc…

Hi @jorndorff,
From your use case, it would make more sense to save the data centrally, saving the data on the ipad is like saving a personal setting/preference, when you save the same centrally on a server, you can collate and do a lot more.

cheers,

This topic was automatically closed after 166 days. New replies are no longer allowed.