I'm currently developing an iOS app and have reached the point where I need to implement a server backend in order to support the core functionality. Essentially, the app deals with text strings that need to be uploaded to a server. After receiving the strings, I need the server to perform some tasks with it and then send the result of the tasks (also string-based) back to the iPhone app.

I have zero server experience and am need of some advisement as to where I should begin with this. In order to avoid financial risk, I am attempting to avoid dedicated hosting at initial launch, and so I was wondering if at-home server hosting would be at all possible for the launch and then, if the server-side component was developed appropriately, simply transfer the software to a more permanent dedicated solution if the app's usage warranted. (Sorry if that last bit made no sense, I'll just namedrop XML and IP Address to make it seem like I know what I'm talking about.)

I have done some research and I have found Amazon S3 to be a popular iPhone app server solution due to its integration with the also popular wrapper, ASIHTTPRequest. This seems to be a more permanent hosting solution, however. In the meantime, for local app testing on a smaller scale, what would the recommended server platform be? Something along the lines of ubuntu with LAMP installed? If so, would the scripts developed on the local platform (I'm assuming in PHP) be directly transferrable to a larger-scale server for the most part?

Thanks, and sorry for the probably technically illiterate inquiry into servers. As you can see, I'm new to this aspect of development.

-Harrold K

Comments

You could use Amazon EC2 instead of S3. It offers a micro-instance for free upto a certain limit which is sufficient for most cases when you're starting out - aws.amazon.com/ec2

Written by Anurag

That sounds very interesting, this is pretty lame but would you happen to know if the ASIHTTPRequest wrapper supports that as well. I would assume a server is a server as far as the wrapper is concerned, but I'm just checking. Thanks for the quick response!

Written by Harrold Kenning

ASIHTTPRequest is merely a wrapper for making http requests. You would have to setup a web server on the instance and make it publicly accessible which ASI will then connect to. ASI can make HTTP requests to any accessible web server, so that shouldn't be a problem.

Written by Anurag

Oh ok, so if I chose to even bypass the free Amazon EC2 for a little while just to get my feet wet in server-client communication, would something like an apache server running on an old pc in my house suffice?

Written by Harrold Kenning

Oh definitely, you can setup Apache on your own machine, and connect to it from the iOS app. I have a similar setup where I sometimes connect to a local web server running on my laptop using a 10.0.x.x IP. Once you feel the need to grow further, you could go with EC2 or any other hosting provider.

Written by Anurag

Thanks for your help, Anurag... that's exactly the sort of clarification I seeking.

Written by Harrold Kenning

you can use a public folder in dropbox. each file has its own link.

Written by Jordan Brown

Accepted Answer

I would go with shared hosting: http://webfaction.com or http://linode.com. It's unlikely that you're going to have so much traffic that your shared host will not be able to tolerate it. I run a few high traffic apps on Webfaction without difficulty.

From your description of the functionality in your app, it doesn't seem too complicated, and wouldn't be difficult to scale.

PHP development environment on OS X:

OS X has PHP and Apache already installed. It just needs to be enabled, this page describes the process to get it going:

http://foundationphp.com/tutorials/php_leopard.php

Alternatively you can install a package like MAMP ( http://www.mamp.info/en/index.html ), which will provide you with a full stack. (And is what I would recommend.)

The code:

As for the code, you'll more than likely use ASIHttpRequest to do a POST request to URI on your server. The script at the URI will connect to the database, store the string, and then disconnect from the database.

Less than 10 lines of code.

Written by peterp
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki