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

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex