I am doing a series to give a behind the scene look at the making of a Windows Phone 7 app. In the process I realized that there is really no information around mobile applications integration with Windows Azure. This is my attempted at providing the how and why we want to use Azure in your apps.
While some of the problems I am solving with Azure could be solved in a regular hosted account or shared virtual server, Azure gives me three very important features; redundancy, scalability and elasticity. Out of the three elasticity is the big one. I can accomplish the first 2 by going out and spend thousands of dollars creating a solid and robust infrastructure but that would still not make it elastic. To be elastic you must be able to scale your infrastructure up or down in a matter of minutes. This is crucial if you apps get feature on an app store or on a tech site.
Service Layer
So why do we need a service layer for our apps. First let me say that not all apps need a service layer. A tip calculator for example does no need one. It is self contained and everything it needs to work is on the phone. It could use a service layer to enable some extra features but more on that later.
Here are some of the reasons why adding a service layer to your app makes sense:
Message Format Abstraction
Many mobile apps rely on 3rd party data. This data is typically accessed via a service API. If apps are directly coded to these APIs they become coupled/tide to them. This means that if for whatever reason the format of the API changes, you need to would need to update your apps. This means changing the code code, testing and submitting it to the app store. At the very least, it would take a few days to have the new version on the app on the app store. You would need to worried about current customers but cause they might not notice the new version and hence just think the app is no longer working. A service layer fixes this issue. If the 3rd party APIs changes, all you would need to do is to change your server layer to adapt to the new format. The service layer also allows me to change data providers or have a back up data source in the case the pain provider service is not available. Data Cache & Mining Many of these APIs used on mobile apps do not have service level agreement. This means the published does not guarantee that its data will be available at all times. If they do, you typically have to pay more for the data. But in either case, if your app is not working because it does not have access to data, your user will blame you and not the data supplier.
Many mobile apps rely on 3rd party data. This data is typically accessed via a service API. If apps are directly coded to these APIs they become coupled/tide to them. This means that if for whatever reason the format of the API changes, you need to would need to update your apps. This means changing the code code, testing and submitting it to the app store. At the very least, it would take a few days to have the new version on the app on the app store. You would need to worried about current customers but cause they might not notice the new version and hence just think the app is no longer working.
A service layer fixes this issue. If the 3rd party APIs changes, all you would need to do is to change your server layer to adapt to the new format. The service layer also allows me to change data providers or have a back up data source in the case the pain provider service is not available.
Data Cache & Mining
Many of these APIs used on mobile apps do not have service level agreement. This means the published does not guarantee that its data will be available at all times. If they do, you typically have to pay more for the data. But in either case, if your app is not working because it does not have access to data, your user will blame you and not the data supplier.
Historical Reference At times it is beneficial to provide historical information on the data. Like, what was the weather last week or what was the hottest day of the year so far. Now it likely that the data supplier you are using is already providing this historical information but maybe not. It might be also be good to provide trends to your users. Keeping data for a period of time might be able to provide this. Syncing between devices is also a nice feature. I love it when I can use my kindle app on my phone and the information is synched back to all my devices.
Historical Reference
At times it is beneficial to provide historical information on the data. Like, what was the weather last week or what was the hottest day of the year so far. Now it likely that the data supplier you are using is already providing this historical information but maybe not. It might be also be good to provide trends to your users. Keeping data for a period of time might be able to provide this.
Syncing between devices is also a nice feature. I love it when I can use my kindle app on my phone and the information is synched back to all my devices.
Social Experience Social is where is at. Adding social media components to your apps could be the difference between a good app and big hit. For example, a player might spend more time playing you games if you have a higher score tracking feature. People respond to competition.
Social Experience
Social is where is at. Adding social media components to your apps could be the difference between a good app and big hit. For example, a player might spend more time playing you games if you have a higher score tracking feature. People respond to competition.
Push Notification If you application uses push notification, you would need a way to send notifications to the devices. Typically this is information that the users have subscribed to so your system needs to push the data to the users. Azure Worker Roles are perfect for this. They are able to sit on the background typically on a loop waiting and looking after data. When the data comes in it can “push it” to the phone.
Push Notification
If you application uses push notification, you would need a way to send notifications to the devices. Typically this is information that the users have subscribed to so your system needs to push the data to the users. Azure Worker Roles are perfect for this. They are able to sit on the background typically on a loop waiting and looking after data. When the data comes in it can “push it” to the phone.