Reputation: 4605
I commonly hear Web API and Mobile Services used interchangeably, as they offer many of the same things. What are some of the key differences and similarities between the two technologies, and why would I use one over the other?
Upvotes: 2
Views: 1536
Reputation: 4605
Mobile Services vs Web API
Mobile Services supports two types of backend: Javascript (Node) and C# (WebAPI).
For node.js developers
For any non .NET developer, I encourage them to use Node since it’s quite popular and many devs are already familiar with it. The Node backend is also much simpler to work with. Here is a tutorial on how to get started.
For .NET developers
Web API requires an ASP.NET solution. Mobile Services will build the project for you but from there you have more work to do and you need to be familiar with .NET.
My understanding is that you’ll get a lot more control over your solution with WebAPI compared to Node. If you’re actually building your own API for your service instead of just accepting HTTP Verbs over REST. In that case, WebAPI is a better solution since Azure provides facilities for API management.
Offline support
The WebAPI (.NET) approach offers offline as well. You’re basically getting all of Mobile Services in a local project, so you can debug. There’s not a full offline story for the JavaScript (Node.js) version, though you can download the scripts via the git endpoint, edit in VS, and then deploy easily. In other words, you don’t have to go to the browser to edit all of your JavaScript.
Service Level Agreement (SLA)
Basic and Standard Mobile Services : 99.9% Websites (Web API) : 99.9% is only when using multiple instances (Need basic or Standard plans)
This means mobile services gets an SLA of 99.9% with the lowest price of $15/month.
Websites (Web API) minimum is $112 / month because of needing 2 of the smallest instances. So anyone that needs / wants the SLA could save money with Mobile Services.
Identity
Mobile Services has setups for the major social networking as well as AAD. Web API can be coded and setup to use identity from AAD and tie that into other services as well. This means that for many developers, Mobile Services will be easier to setup.
Push Notifications
Mobile Services has a basic push built in as well as notification hub. Web API can use notification hub.
Backup
Websites have a backup feature. Additionally, you can connect your Azure website (Web API project) to a local Git repo or one hosted on GitHub as well.
Mobile Services (JS) use an automatically created Git repo in Azure and for .NET, you should be using source control anyways.
Scheduled Jobs
Mobile Services has Scheduler (can only be run on a schedule or on demand.).
Web API has WebJobs, which can be run continuously, on demand or on a schedule.
ASP.NET 5
If you want to see how things are changing in the new version of ASP.NET 5, this video on Channel 9 from Scott Hanselman will give you a better picture.
Upvotes: 2