6

I want to create an iPhone app that will sync with its online webb app client.

I currently have my data stored in a .plist. Will SQLite be the best way to go about this?

Also I will need to set up user accounts / registration database. Any sites or tutorials that deal with this stuff?

Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

7

@Faisal:

Hi again.

Yeah you can use SQlite but I would suggesy you to go for the MySQL database on your database server and then you can parse data using JSON and fetch the data.

This will decrease an overhead of synchronization of database and also the iPhone app will be more light weight.

EDIT:

If you are new and have no background of database then it is better that you start with the Sqlite and then move on to the core data to store your data in iPhone or in that case MySQL to store your data on server.

EDIT-2:

This is a link which gives you many different options to learn SQlite and its implementation in iPhone app.

Where's the best SQLite 3 tutorial for iPhone-SDK?

Hope this helps you :)

Community
  • 1
  • 1
Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • @Faisal : If you have doubts on this then feel free to leave a comment here. – Parth Bhatt Mar 20 '11 at 10:12
  • Thanks Parth. At this point I have absolutely no background in database so do you think I will be able to set this up properly? The reason I suggested SQLite was because it seems like that would be the easiest to implement due to it being built into the iOS framework. –  Mar 20 '11 at 10:17
  • You are Welcome :) Yeah in that case you can go with Sqlite. it is very simple and light weight database. Also as you are new into this I would suggest you to install Firefox into your Mac and use "Sqlite Manager" Add-on. That would be very easy for you to begin with Sqlite database and to access the database without much of complexity. Hope this helps you. – Parth Bhatt Mar 20 '11 at 10:20
  • Thanks it definitely helps. Can SQLite manage user accounts and registraion information? I guess what Im asking is if I can use SQLite for all database management. So I would have my iPhone app, SQLite for database, and a web client using HTML and Ruby on Rails or something similar. –  Mar 20 '11 at 10:27
  • ok but then how are you planning to synchronize your SQlite database on server? – Parth Bhatt Mar 20 '11 at 10:30
  • Ok, you're right. So is there another language/technology involved to accomplish that task? And also, how does CoreData fit for my needs? –  Mar 20 '11 at 10:33
  • 1
    CoreData does fit into your needs if you have to use a very simplified database structure in iPhone app. Also it would be very easy to store the data and synchronize it with server using JSON. if synchronization with server is concerned then even SQlite would be good as you just have to convert you Sqlite tables into CSV and then parse the CSV into the database on server. – Parth Bhatt Mar 20 '11 at 10:37
  • Ok so I will look into CoreData then. I'm trying to build a weight lifting log app so I just need the data synced so users can view it online etc. The data model seems to be fairly simple. –  Mar 20 '11 at 10:39
  • **Learning SQLite before learning CoreData is a waste of time**. There is absolutely no need to learn SQLite first. For relatively simple to medium complexity needs, Core Data will serve your needs without ever seeing a line of SQL or any of the sqlite() API. On the server side, it is exceedingly unlikely that you would use SQLite or Objective-C. – bbum Mar 20 '11 at 16:44
2

You have two distinct problems; local storage and the client server data push.

For the local storage, the data model is simple (based on comments on PARTH's answer) and, thus, Core Data would be a perfect fit.

There is no need to learn SQLite first before using Core Data. Core Data is an object graph persistency and change management solution. SQLite happens to be one of Core Data's persistency mechanisms, but that is an implementation detail that is largely entirely hidden behind the higher level APIs.

For the client/server piece, using HTTP + JSON will work just fine for communicating from your app to the server.

On the server side, go with any of the myriad of different already written solutions for managing this kind of data. For this kind of application, PHP+MySQL is likely a perfectly acceptable solution in that registration + simple data storage is a problem that has been solved about a million times with that combination of tools (and, thus, you'll be able to find 100s of writeups of how to do exactly that).

bbum
  • 162,346
  • 23
  • 271
  • 359
  • Ok, thanks bbum. I'm going to look into PHP+MySQL and see what I can find. –  Mar 20 '11 at 23:54