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

How to check in AngularJS if a service was register or not

There are cases when you need to check in a service or a controller was register in AngularJS.
For example a valid use case is when you have the same implementation running on multiple application. In this case, you may want to intercept the HTTP provider and add a custom step there. This step don’t needs to run on all the application, only in the one where the service exist and register.
A solution for this case would be to have a flag in the configuration that specify this. In the core you would have an IF that would check the value of this flag.
Another solution is to check if a specific service was register in AngularJS or not. If the service was register that you would execute your own logic.
To check if a service was register or not in AngularJS container you need to call the ‘has’ method of ‘inhector’. It will return TRUE if the service was register.
if ($injector.has('httpInterceptorService')) { $httpProvider.interceptors.push('httpInterceptorService&#…

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.51EF 6.0.2VS2013
It seems that there …

[Post-Event] Codecamp Conference Cluj-Napoca - Nov 19, 2016

Last day I was invited to another Codecamp Conference, that took place in Cluj-Napoca. Like other Codecamp Conferences, the event was very big, with more than 1.000 participants and 70 sessions. There were 10 tracks in parallel, so it was pretty hard to decide at  what session you want to join.
It was great to join this conference and I hope that you discovered something new during the conference.
At this event I talked about Azure IoT Hub and how we can use it to connect devices from the field. I had a lot of demos using Raspberry PI 3 and Simplelink SensorTag. Most of the samples were written in C++ and Node.JS and people were impressed that even if we are using Microsoft technologies, we are not limited to C# and .NET. World and Microsoft are changing so fast. Just looking and Azure IoT Hub and new features that were launched and I'm pressed (Jobs, Methods, Device Twin).
On backend my demos covered Stream Analytics, Event Hub, Azure Object Storage and DocumentDB.

Title:
What abo…