Reputation: 1916
I'm writing a weather app that learns what you wear based on current conditions/temperatures to tell you what you should wear outside. I'm collecting some simple data and storing it on the device. I'm collecting:
I will query the data based on the current temperature/condition to get an average of the values in the 6 int fields to predict what the user usually wears.
I'm keeping this on iPhone only. What would be a good, client-side, data storage method for this? The queries aren't too intense, but I need to query on type and range.
I haven't used Core Data before. Very familiar at MySQL but haven't touched SQLite. Again, I'd like to keep this client-side and not use a database for the sake of simplicity/speed. I'm aiming for a get-in/get-out app.
Upvotes: 2
Views: 1011
Reputation: 666
A previous poster recommends Core Data over SQLite. Although they're right to suggest one of those two alternatives, if you are already familiar with MySQL and you're looking for a get-in/get-out app, I'd recommend you go with SQLite.
Core Data is an excellent framework, but there is a learning curve that may not be worthwhile considering your specifications and your previous experience. SQLite is simple, fast, and client side. Moreover, your queries won't look any different from MySQL.
Other posters mention serializing over NSUserDefaults or NSKeyedArchiver. While they do make serialization simple, you'll end up rolling your own query code using NSPredicate. It's not so difficult, but again, it may be a new technology that, while worthwhile, is better saved for another time. More of a concern is that they won't scale well if your app does start using a lot of data quickly.
Regarding scale more generally, ff your app does become wildly successful, worry about it then. You can always refactor and scale when it's necessary.
Upvotes: 1
Reputation: 2527
I would recommend using Core Data or SQLite. Your right, this is not a lot of data being store. What if that Application is a success, and you want to expand your concept?
For example:
(1) You want to store more data
(2) Maybe sync data to a server
(3) Changing the type of data your storing
You even mention QUERY in your question, to me that is your answer right there. This would all be much easier with Core Data. There will be a learning curve, but learning this framework will be beneficial with future projects.
Good luck with your project.
Upvotes: 2