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

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.