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(

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine: threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration: TeamCity .NET 4.51 EF 6.0.2 VS2013 It see

Navigating Cloud Strategy after Azure Central US Region Outage

 Looking back, July 19, 2024, was challenging for customers using Microsoft Azure or Windows machines. Two major outages affected customers using CrowdStrike Falcon or Microsoft Azure computation resources in the Central US. These two outages affected many people and put many businesses on pause for a few hours or even days. The overlap of these two issues was a nightmare for travellers. In addition to blue screens in the airport terminals, they could not get additional information from the airport website, airline personnel, or the support line because they were affected by the outage in the Central US region or the CrowdStrike outage.   But what happened in reality? A faulty CrowdStrike update affected Windows computers globally, from airports and healthcare to small businesses, affecting over 8.5m computers. Even if the Falson Sensor software defect was identified and a fix deployed shortly after, the recovery took longer. In parallel with CrowdStrike, Microsoft provided a too