b2cloud

30th October 2014

App processing vs server processing

Thoughts By 2 years ago

When building an app that connects to a web service it’s often best to put the processing load on your server, as opposed to the app.

For example, say your web service returned a list of addresses to your app. To show these on a map, the app could go and reverse geocode each one to get its latitude longitude, and then show a pin on the map.

A better solution would be to have the server do this work, and include the latitude longitude alongside the address.

This provides many advantages (some generic, some specific to this example):

  • A mobile phone’s network is unreliable, people move in and out of bad coverage areas such as tunnels frequently. A server has a very reliable connection.
  • A mobile phone has a battery, any unnecessary work is going ¬†to impact your user’s battery life. The example used above may have a negligible impact on the battery (it will have an impact, even if extremely low), however other examples may yield noticeable¬†battery drain (see the very end of this post).
  • A mobile phone’s processor is a lot slower than a server. If processing large quantities of information, it’s going to happen faster on a server.
  • In the example above, if you found the geocoding service used was inaccurate, changing it would require an update to the app. If the server was doing this work then it’s easy to update without needing to change the app.

Of course there are other trade offs to consider. The main advantage of processing information in an app is that you do not need to be online to do so. This obviously doesn’t apply to my example above, where geocoding requires a network connection anyway.

Another good example of this in action is Apple’s push notification system. To send a push notification it must be sent through Apple’s push notification server, instead of directly to the app. If it was going directly to the app, then each app on your phone that uses push notifications would need to maintain an active connection to whatever sever sends out the notifications. Because all notifications go through Apple, instead the device can maintain just a single connection with Apple, which acts as the middleman for all notification activity. Because of this, the notification system has very little impact on battery, even though it puts an extreme load on Apple’s servers (they send millions of notifications every second).

Recommended Posts

Opening the Settings app programmatically in iOS 8

Post by 2 years ago

When iOS 7 first launched developers found the hidden URL schemes used by Apple to open the Settings app from another app. Developers started using this hidden URL in their apps. Apple realized and took

Got an idea?

We help entrepreneurs, organizations and established brands from around
the country bring ideas to life. We would love to hear from you!