1

My app reads data from two sources, a local sqlite file and a remote server which is a clone of the local db but with lots of pictures. I do not write to the server database, but I do need multiple simultaneous fetch operations.

What DBMS should I use for storing information on the server?

It needs to be very easily used from an iPhone app, be reliable, etc.

NCFUSN
  • 1,624
  • 4
  • 28
  • 44
  • Pleas explain a little better what do you mean by `What kind of SQL is the best for storing information on server in my very special case?`? What does SQL has to do with storing your data? – Icarus Nov 14 '11 at 05:33
  • Please review my edit. I've tried to improve it, but I'm not sure if I'm missing any of your requirements for the server database or how it needs to be used. –  Nov 14 '11 at 13:28

2 Answers2

2

Talking to a remote server should not be tied to any platform like iOS. If you have control over the remote db server, the best bet IMO is crafting a RESTful API which you express your queries in, the server processes it and sends you the pictures/records using proper content type. If you do NOT have such control over the remote db, you'll have to stick to the API the db hoster provides. There are plenty such "on the cloud" db hosters (including NoSQL solutions) that give you a web-services interface to your db. MongoLabs is one such provider for MongoDB(which is a NOSQL db - meaning no schemas, no bounds on the structure of a "table"). You can continue to stick to SQLite on the client side.

yati sagade
  • 1,355
  • 9
  • 24
0

You seem to have two sources of data local storage and a remote server.

This question on SO might help you to decide approaches of storing data on the server.

Once you have downloaded data using something like NSURLConnection class the images could be stored in the filesystem using writeToFile or the likes. - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag method.

You might like to save the rest of the data in sqlite. We used sqlite and the CoreData framework to save data for one of our applications and it worked fine for us. CoreData allowed us to interact with the database without actual SQL queries.

The iPhone client resides on the phone while on the server side we might have a database and a webservice interacting with the db. Webservice itself might be implemented in python or php like scripting language. The client interacts with the webservice that might return data in formats like XML or JSON. Thus there is no direct communication between the client and db. However, the client does implement network communication code to communicate with the webservice. This page shows how to consume an XML based web service.

Community
  • 1
  • 1
Manali
  • 577
  • 4
  • 11
  • Thank you for reply, but I was not meaning to store images in DB. Only file names. So, my question is what type of SQL is the best approach in my case. – NCFUSN Nov 14 '11 at 06:01
  • From an iPhone client point of view it does not really matter which db you are using at the backend. For implementation on iphone device however it has to be SQLite. – Manali Nov 14 '11 at 06:54
  • Do I understand right? I can upload to some webserver data.db and connect to it like: http://www.myserver.com/data.db ? And it will work well even if much users will occur to read from this file? – NCFUSN Nov 14 '11 at 13:28
  • Like YatiSagade has said, you use web services to fetch data from the server. It could be your API or the one provided by the hoster. The call could look something like 'https ://my.domain.com/recent/backed'.... The iPhone client that calls the web service does not know which database is being used at the backend. How well the DB processes multiple simultaneous requests depends upon the your choice of DB, it really does not have anything to do with the iPhone app – Manali Nov 15 '11 at 12:55
  • All right. I will reconfigure my question. May I connect to sqlite database placed on some webserver in the same easy way like to file placed in my app? – NCFUSN Nov 18 '11 at 04:13