Skip to main content

Azure Mobile Services (Day 14 of 41)

List of all posts from this series: http://vunvulearadu.blogspot.ro/2014/11/azure-blog-post-marathon-is-ready-to.html

Short Description 
Mobile Services are a collection of Azure services dedicates to developers that are developing mobile application. This services can be your best friend if you are developing a mobile application that requires backend.
With a minimal development time, you can build your application backend without needing to invest time, energy or money. Mobile Services is a solution cross platform, meaning that you can use it as a single backend for your iOS, Adroid or/and Windows Apps.


Main Features 
Push support
There is full support for push mechanism, which give us the ability to push content to our applications. The most interesting things is how you push the content. You can push the same content for all your mobile clients (even if there are WP clients, iOS or Androids) clients. The API give us the ability to push the content in the same way.
Broadcasting support
Can be used with success to push not only one notification to one client, but we can also broadcast notifications and messages to them.
Single Sign-On
In combination with Active Directory we can create application dedicated to enterprise segment that use Single Sign-On support of Active Directory.
Offline/Online support
There is full support from Mobile Services to create applications that can work in both ways and that are able to synchronize the data content in the moment when a connection is available.
Analytics
Mobile Services can be used to monitor your application and know the health of your application, create client profiles and many more.
Scaling
This service is not create for 10 clients, 100.000 clients. This is the kind of service that can scale very easily from 10.000 clients to 10M clients very easily and in the same time you will play only what you use - nothing more.
Social Integration
We have support for different authentication mechanism. On top of Active Directory, we can use as authentication mechanism Facebook, Google or Twitter. The client part is full managed by the library. Because of this, for example, you can integrate Facebook authentication in less than 15 minutes.
Support for different databases
Mobile Services give us the possibility to integrate and use different databases from Oracle or SQL to NoSQL databases like MongoDB. Because this is a flexible and adaptive solution integration with different providers and services is not complex or time consuming.
Secure Connection
An enterprise connection is not only about authentication. We need to be able to establish secure connection to different on-premises resources. From this perspective, Mobile Services is perfect. We can establish a secure connection and use on-premises resources from SAP, Oracle, SharePoint or SQL Server.
Full support from Xamarin and PhoneGAP
Mobile Services is already supported and integrated by PhoneGAP . We can create application using cross-platform solution without any kind of problem.
Fast start
Once you create a Mobile Services service on Azure, you can download a clean project for each mobile platform that is already configured to communicate with your backend. In this way you don’t need to lose time for configuration.
Real-Time communication
The application can have a real time communication between each other and with out on-premises resources. In this way you can create applications that send and receive data to other resources with a minimal latency.
Data Storage
We are allowed to store data SQL, Table Storage or MongoDB by default.
Full access control to resources
This service enable us to have a granular access control for each user. For example we can allow only to a specific users to access data from a specific table. In this way we can keep user personal data in a secure way that is offered out of the box.
Data can be stored in table that are created inside Mobile Services. This tables can be managed easily and we have also support for custom triggers.
JavaScript for triggers
The language that can be used when we need to define a trigger is JavaScript. This is a well know language – because of this developers don’t need to learn a new (another) language.
Scheduling support
There is full support to define scripts that can run at a specific time interval. For example we can schedule cleaning steps to run every day at a specific time.
Custom API and backend
Yes. We have the ability to define custom backend and expose it as an API that can be consumed by our mobile applications. Using this feature, we can extend the capabilities of Mobile Services with the one that we need.
HTML and web application support
Beside mobile application, we can use Mobile Services for our web application. All the services are exposed as REST API that can be consumed and accessed by web application also.
Debug Support
This is a very nice feature that allow us to debug our code that runs on Mobile Services. For example we can very easily debug JavaScript code that is written by us and runs on Mobile Services. In this way we don’t need to use the modify and test approach when we have a problem.
GIT Integration
We have support to integrate Mobile Services with GIT and make deployment directly from out GIT account.

Limitations 
For normal mobile applications I don’t see any kind of limitations that could be blockers. We could have issues if we create mobile application that needs a lot of CPU resource power on the backend. In this scenario we may need on top of Mobile Services another source of CPU power, but this are special use cases and we should handle with care.
For example data reporting over a database should not be done by Mobile Services. The reporting part should be made by another services of components.

Applicable Use Cases 
Below you can find 4 use cases when I would use Mobile Services.
Tracking Application
A mobile application that can track user’s location can use a backend Mobile Services. We could use this service not only to store user GPS location, but also create different view of data or notify other users when a specific other users if a user is in trouble.
User personal settings
Because nowadays, a person has more than one smart device (tablet and phone for example) we need a mechanism to synchronize user data. In this case we can use Mobile Services as a synchronization platform that allow users to have the same configuration on phone and tablet.
Sharing ideas app
Because we have the ability to share content with specific users (table content) we can create a ‘social’ networks that allow uses to share their ideas with friends and family. For a use case like this, the backend implementation would be very simple.
Notification broadcasting
Mobile Services allow us to broadcast messages to Android, iOS and Windows Apps. For scenarios when we need to broadcast notification to devices that are on different platforms, this service can be used with success.

Code Sample 
// Connect to Mobile Services
MobileService mobileService= new MobileServiceClient("https://foo.azure-mobile.net/","[secretKey]");

// Get data from a table
var carTable = mobileService.Context.Current.MobileService.GetTable<Car>();
var car = await ticketTable.LookupAsync(carId);


Pros and Cons 
Pros

  • Integration with different social vendors
  • JavaScript language support for custom backend code
  • Simple to use
  • Extensible
  • Data Access management  
  • Cross-Platforms
  • Strong Notification infrastructure

Cons
-


Pricing 
When we want to calculate the cost how much Mobile Services would cost we need to take into account the fallowing components:

  • Number of API calls
  • Number of devices
  • Number of units (for scaling)
  • Number of push notifications
  • Support for offline sync
  • Backend tasks complexity and volume
  • Outbound data traffic


Conclusion
I think that Mobile Services is a good options to create the backend of our mobile applications.
It can be a good solution not only for enterprise but also for startups when resources are limited (money and time). If I would be a startup my first option for backend would be Mobile Services.

Comments

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

Azure AD and AWS Cognito side-by-side

In the last few weeks, I was involved in multiple opportunities on Microsoft Azure and Amazon, where we had to analyse AWS Cognito, Azure AD and other solutions that are available on the market. I decided to consolidate in one post all features and differences that I identified for both of them that we should need to take into account. Take into account that Azure AD is an identity and access management services well integrated with Microsoft stack. In comparison, AWS Cognito is just a user sign-up, sign-in and access control and nothing more. The focus is not on the main features, is more on small things that can make a difference when you want to decide where we want to store and manage our users.  This information might be useful in the future when we need to decide where we want to keep and manage our users.  Feature Azure AD (B2C, B2C) AWS Cognito Access token lifetime Default 1h – the value is configurable 1h – cannot be modified

What to do when you hit the throughput limits of Azure Storage (Blobs)

In this post we will talk about how we can detect when we hit a throughput limit of Azure Storage and what we can do in that moment. Context If we take a look on Scalability Targets of Azure Storage ( https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/ ) we will observe that the limits are prety high. But, based on our business logic we can end up at this limits. If you create a system that is hitted by a high number of device, you can hit easily the total number of requests rate that can be done on a Storage Account. This limits on Azure is 20.000 IOPS (entities or messages per second) where (and this is very important) the size of the request is 1KB. Normally, if you make a load tests where 20.000 clients will hit different blobs storages from the same Azure Storage Account, this limits can be reached. How we can detect this problem? From client, we can detect that this limits was reached based on the HTTP error code that is returned by HTTP