views:

54

answers:

2

I am trying to plan out a few iOS/server apps for internal use. On the iOS side I'll use Core Data, but I'm not so sure what many people do on the server side. I will be running a Mac Mini with OS X Server 10.6.X. This app will need to sync when the iOS device is on the internal WiFi as well as over 3G. Some of this data will need to be accessed by the company's external web site which is written in PHP, as well as by native apps on iMacs internally. Should I just use a MySQL db on the server, and expose a web service, or is there a better way by using Core Data on the server that would make syncing the iOS device easier? The data is not too relationally complex. I'm thinking tblClient 1->M tblJob 1->M tblImage/Drawing.

+2  A: 

In most cases, the server side doesn't matter because your communicating with URLs and some standard data format like JSON.

You can connect to a remote Core Data store but it doesn't handle multiple access so there's seldom much point to doing so. You could write your own server that uses Core Data but usually its quicker and easier to use a preexisting package dedicated to server work.

My advice is to go with the server that is quickest and easiest for you to implement and maintain with the knowledge and tools you have on hand. It's easier to adapt the client side Core Data to inputs from the server than it is to attempt to integrate Core Data directly into the server.

TechZen
I figured it would be this way, I just didn't know if using Core Data on the server side and using WebObjects or something would make it possible to sync Core Data records without having to parse them to and from JSON or XML.
jamone
I would add to this that converting JSON that is structured to match your data model is a LOT easier to parse than non-matching JSON or worse XML.
Marcus S. Zarra
Marcus makes a good point. Since you control both client and server you should take care to take advantage of that.
TechZen
A: 

http://ODBCrouter.com/ipad (new) has XCode client-side ODBC (Open Database Connectivity) objects that would let your mobile apps, your Mac apps (Excel, FMPro, etc..) and your PHP website all access the same MySQL database at the same time through the official MySQL ODBC driver installed along side of an ODBC Router (see screen shots). The only issue though is that you'd have to run a Windows instance in VMware Fusion on your Mac because ODBC Router only deals with what the database vendors are willing to support, which is 32-bit Windows ODBC drivers. The client-side stuff that runs on your iPhone, Mac and PHP server is all free, the ODBC Router component is about the same cost as a TV. The alternative to date is to write and forever maintain some SOAP/REST server that serves JSON/XML.

AugSoft Tom