We talked about Scalability previously. So what is mobile scalability? Mobile devices and smartphones run applications just like your laptop or home computer. However these applications have some special requirements such as location-based search. They also are typically not as weighty as their desktop counterparts, as memory and computing cycles are limited on a mobile device. What’s more they should have a reduced network requirement and make fewer roundtrips between the device and the server.
Just like for other web applications, mobile scalability involves a few key areas:
- load balancing the webserver tier
- load balancing the database tier
It also introduces these new requirements:
- fast location based search and lookups
- minimal network usage
For the operations team tasked with optimizing a mobile application, pay particular attention to the measured amount of data that moves back and forth on each page. Optimize images and/or remove them if possible. Adjust layout for the most popular devices, and spend extra time testing for those.
To address the location based search requirements, look at what’s happening on your database tier. If you’re running MySQL, enable the slow query log, and watch for heavy queries doing location-based lookups. If you’re not already using a radius indexes, definitely consider those as a way to speedup such lookups.
Also consider creative ways of looking at the business requirements to reduce actual computational power. What do we mean by this? Chances are the business team discusses what the application needs to do and the developers then go about figuring out how to do it. But what happens as in the case of a location search, when the how is very expensive and slow? It may be that customers think about nearby me in a much looser way than the technical folks do. They may not care that you offer them businesses that are exactly within a one-mile radius at all. They may be happy enough with a search that puts them uniquely inside one zipcode for example, or alternatively by breaking a city area for example into adjacent boxes instead of circles. A square or rectangular area will be at least an order of magnitude (10x) faster but possibly as much as 100x faster because you can index perfectly on latitude and longitude lines, then compare the lat and long location of the businesses nearby.
This creative solution may fit business requirements and will bring huge speedups to your database tier, and thus your overall mobile application. Scalability indeed!