Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Microsoft Releases iOS Mobile Services 2.0 Beta

Microsoft Releases iOS Mobile Services 2.0 Beta

Microsoft has recently released a new preview of its 2.0 Mobile Services iOS SDK. The SDK allows iOS developers to easily integrate their mobile applications with Mobile Services backends hosted on Azure.

Mobile Services is a MBaaS (Mobile Backend as a Service) with support for cloud storage, push notifications, authentication, mobile analytics and custom APIs written in Node.js or .NET. All of these services can be accessed via REST APIs or alternatively via the client SDKs, which are available on Android, iOS and Windows Phone.

The major change in this release of the SDK is the improved support for Azure Tables, Microsoft's NoSQL key-value datastore. In particular, the client SDK now offers the ability to page and skip results when querying. The benefit of this addition will be the improved performance when dealing with large datasets, as is often the case when utilising a key-value datastore.

In order to support this feature Microsoft have had to make a number of breaking changes to their client side APIs, which developers moving from the previous 1.2.4 release of the SDK will need to accommodate. Previously when executing queries on a datastore all results were returned asynchronously in a single array, as per the code sample below:

typedefvoid(^MSReadQueryBlock)(NSArray*items,NSInteger totalCount,NSError*error);

[query readWithCompletion:^(NSArray*results,NSInteger totalCount,NSError*error){...}];

To accommodate paging and skipping of results, the returned items are now embedded within a new MsQueryResult object as illustrated:


[query readWithCompletion:^(MSQueryResult*result,NSError*error){...}];

The MsQueryResult object exposes both the returned items array along with a continuation link, which points to the next page of results. This abstracts the client from the underlying REST APIs which utilise HTTP link headers as described by Carlos Figueira in his recent post on the Azure development blog.

When we released the .NET backend for Azure Mobile Services, we provided support to store data in Azure Table Storage and MongoDB databases (in addition to the SQL Azure storage which has been used since the first version of the service). The support for table storage, however, wasn't great, in a sense that if the table had a large number of items: the table storage doesn't support "skipping" items like SQL queries do, so the application couldn't use paging to navigate through all the items in their tables. Instead of using skip / take, table storage supports paging via continuation links (exposed as HTTP Link headers), in which the response for a request which doesn't include all items will have a link which the client should use to retrieve additional items. Those continuation links weren't exposed in the client, however, so there was no way to consume large tables.

In line with the release of the 2.0 beta, Microsoft have also published a number of updates to their sample applications for the SDK. An updated version of the official 'TodoOffline' sample application for the SDK is available from the project's samples GitHub repository.

In August Microsoft released its previous beta preview which included support for offline-sync. With offline-sync any modifications made to an application's data whilst offline are saved to a local SQLite database via CoreData, and then propagated to the Azure backend when the device regains connectivity. As well as offline-sync the company recently announced its intent to offer real-time user analytics after its acquisition of mobile analytics provider Capptain.

Azure Mobile Services is a paid for MBaaS with a tiered pricing model. Developers wishing to trial the service can avail of the free plan which offers a 20MB database, support for up to 500 active devices and up to 500,000 API calls per day. In addition Microsoft offers basic and standard tiers which cost $14.99 and $139.99 per month respectively. For a comparison of the available plans refer to the Mobile Service's pricing details.

Rate this Article