This tutorial series takes you through how Azure Mobile Services provides Mobile-Backend-As-A-Service by discussing various features and basics of how to get started.
Till now we have covered some of the key functionalities of Azure Mobile Services. We looked into Storage services, Notification Hub and Authentication. One of the key features that we still need to cover in this final section is backend service scripting and scheduling of scripts. So let us have a look at what each of these have to offer.
For .NET backend, business logic operations are written using ASP .Net Web Api using NuGet packages available for client SDKs for Windows, iOS and Android. Table operations are abstracted using a universal table which represents a CRUD based HTTP API for data storage. The TableController class is customized for CRUD data access pattern.
Once you click on the Data tab, create and click on the table, you will see the tab called scripts where you can customize your business logic for Insert, Update, Delete and Read operations. For each of the operations, you can define or customize the script as per your business logic. Some of the commonly used operations are validation of data, read and writing data, authorizing user, sending push notifications, error handling, etc. All of these example server scripts and more can be found here.
Yes, the functionality of writing server scripts does serve the purpose of customizing business logic in the backend. However, there are instances when a scheduled operation is required and is key to the business logic of an app. For example, you may need to ping a website on a recurrent basis to see if it is up and running. You may need to do some cleanup activity on a daily basis or you may need to poll an endpoint recurrently, archiving old or duplicate records. There are many such scenarios for which scheduling is essential. This functionality is served by the Scheduler in Azure Mobile Services.
Now, when you are creating the scheduler, you will notice that you have an option to execute it on minute, daily or monthly schedule. If you just want to keep a script for ad hoc execution, you can select the On demand option.
Once the scheduler is created, you have options to either change the configuration or you could click on the scripts section and have fun with writing scripts as per your business logic and requirement.
Overall, through this tutorial series we have gone through the various functionality that Azure Mobile Services have to offer. The various services cover all the needs for Mobile Backend as a Service (M-B-a-a-S) and provides a platform to develop scalable apps across the various platforms of Windows, iOS, Android, Xamarin and PhoneGap. I strongly urge you to try out Azure Mobile Services to develop your Cloud Apps. Reach out and share your stories with me @AdarshaDatta.