Skip to main content

My first web-based iPhone application - how to do it right?



I've built my first web-based iPhone app and I have some performance issues that I needs to be resolved. I want to verify that I'm doing it right, so your feedback is really appreciated... :-)





The application presenting data - images & text directly from my remote MySQL DB using PHP based web-services.





I'm using the SDWebImage for lazy-downloading.





Now, I wonder if I'm doing everything right or is there something needs to be modified for better performance -









  1. Each connection to the DB is handling via NSMutableURLRequest using POST method. It's running again if I receive time-out connection from the DB and displaying an alert-view if connection fails.









  2. There is only one PHP web-service for every operation - I mean - if, for instance, I'm running the remote getInfo.php script for fetching information from my DB to be presented on info-view-controller, there is only one copy of this script on my web-site, so everyone's running their app and wants to fetch this kind of info from the DB will call the same file. Is it ok to do it like that? Does it have any impact on performance? Should I duplicate the web-service and create a basic round-robbin load-balancing between several copies?









  3. My DB is physically stored on Asian data-center - I can transfer it to other place. In case my app has traffic from all over the world - would it be better to transfer the DB to European/US data-center? I can duplicate the DB between two sites but I don't think it's necessary and I believe single DB is sufficient.









  4. Based on this information - when I'm testing my app, the response time is good most of the time, but from time to time I'm encountering with high latency/connection failure. Is there something else I need to take into account and add to my configuration?









I hope everything is clear...





Many thanks for your help.


Comments

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.