Skip to content

Repository with demos to back the How to Choose a Mobile Backend talk at Build 2019

License

Notifications You must be signed in to change notification settings

AzureAdvocateBit/build-2019-mobile-backend-1

 
 

Repository files navigation

Choosing a Backend Architecture For Your Mobile App

Choosing the backend architecture for your mobile app can be daunting. Do you go with a traditional WebAPI? Serverless? Maybe a mobile backend as a service (MBaaS) that packages several convenient components for mobile developers together? In this session you will learn about the pros and cons of each, the context of when each makes sense to use, and you’ll see a real-world app built using each of these backends. When you leave this session, you’ll be equipped with the knowledge of how to pick and implement the right backend for your mobile application.

Get Some Azure

You're gonna need some Azure to get this repo up and running - so why not sign up for a free account? 12 months of free services, plus $200 in free credit. More than enough to get you rolling.

Deploying The Demos

First, clone this repo. Download it as a zip. Just get it locally. Then...

Next there is a deploy folder. It contains an ARM template and a Bash script with Azure CLI commands that will deploy everything and setup the environment variables in Azure for you.

Running the Demos

The demo is of a shopping cart application. Within a Xamarin application, it allows the user to browse products, see the product's inventory, and purchase them.

It can be broken down into 3 main parts.

  1. The mobile application
  2. A suite of microservices served as APIs
  3. A suite of microservices served as serverless Azure Functions

The microservices are then broken down into 3 parts as well.

  1. Products metadata - Node.js (or C# Azure Function) with MongoDB
  2. Inventory - ASP.NET (or C# Azure Function) with SQL Server
  3. Shopping cart - ASP.NET (or C# Azure Function) with MongoDB

During the talk, you learned about the trade-offs between building a mobile backend in a "pure web api" format using containers and Azure App Services. Using an event driven Azure Functions approach. Or going with a Mobile Backend as a Service (MBaaS) such as Visual Studio App Center.

Everything will already be running in Azure if you ran the setup script. If you did not, you can run everything locally. Check out this video on how to get it setup.

The video will be coming soon!!!

Miscellaneous Services

There were several miscellaneous services demonstrated that applied to any mobile backend. These are not included in the setup scripts. But they aren't that difficult to setup and will be included in the video below.

The first service is Azure Front Door. Front Door allows you to manage and define global routing of your web application traffic. This means you can route requests to their nearest backend.

The second was Azure Blob Storage and Azure CDN. Blog storage is a cost efficient was to store static, binary data. While a CDN will cache it and bring it to the edge.

Developing Backends For Mobile Apps Talk Summary

Mobile development is hard. Mix in backend development - and then you really have a mess on your hands.

Mobile backends have several, unique, needs that you need to account for

  • API versioning (because not everybody is going to update the mobile app at the same time you roll out a new backend).
  • Offline data and conflict resolution (because nobody stays within wifi or cell reach, and of course they're going to modify data when offline. And of course that data will somehow be out of sync with then server when they go back online).
  • Push notifications (because hey, you gotta get your users' attention somehow)!
  • Tough debugging (seriously, between all the different devices, iOS simulators, Android emulators, fast connectivity, slow connectivity, intermittent connectivity, no connectivity - not to mention just creating the app - debugging is no fun).

Plus mobile backend have table stakes

By table stakes, I mean that these features need to be present in order for a backend to support mobile apps.

  • Scalable (let's face it, the whole reason we write apps is for people to use them, so we want to be able to scale them up).
  • Authentication (we need to know who are users are in order to provide any sort of user-based security or personalization).
  • Data and file storage (goes hand-in-hand with the data from the unique needs section - gotta store that data!).
  • Push notifications (again from the unique needs section, in order for a backend to be mobile, you somehow need to be able to send push notifications from it).

Other Considerations

Then of course there are other things that you need to keep in mind when you're developing apps.

  • Cost (you don't want to blow your life savings just to run a backend for your app)!
  • Productivity (let your development team create the backend in the language they are most proficient in).
  • There will be more clients (like it or not, mobile doesn't exist in isolation, and eventually more clients will use the backend - web, IoT, who knows what else)!

About

Repository with demos to back the How to Choose a Mobile Backend talk at Build 2019

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 89.6%
  • Shell 4.2%
  • JavaScript 3.9%
  • Python 1.2%
  • Smarty 0.5%
  • HTML 0.3%
  • Dockerfile 0.3%