Lessons Learned from Making
Apps Resilient with Azure
Mobile App Services
Matthew Soucoup
Sr. Cloud Developer Advocate,
Microsoft
@codemillmatt codemilltech.com matt.soucoup@microsoft.com
Slides & Code!
Slides: slideshare.net/MatthewSoucoup
Code: github.com/codemillmatt/zumo-resilient
Matthew Soucoup
Sr. Cloud Developer Advocate
Microsoft
Disconnected - Usable
Disconnected -> Reconnected
Conflicts…
Conflicts…
Silent Push
Azure Mobile Apps
Open source C#Cross-platform client SDK
FlexibleExtremely powerful
Why Use Azure Mobile Apps?
Xamarin, iOS, Android
and Windows SDKs
Offline sync
RESTAPI
Offline Sync Data Connections
User Authentication
Push Notifications
Backend
In-App
Silent data pushPurge & refresh
Conflict resolutionPushing dataClient-side schemas
Agenda
CLIENT-SIDE SCHEMAS
Resilient Apps with Azure Mobile App Services
Server Schemas
Client-side Schemas
Keeps data processing where it
belongs (on the server)
Works great with MVVM
Fast downloadOnly data that’s needed
Keep Client Schema Flat - Benefits
Selectively pick data
to store
Optimize local
schema for screens
Mobile specific APIsFlat data
Don’t recreate the
server schema
Lessons Learned
PUSHING & PULLING DATA
Resilient Apps with Azure Mobile App Services
Pushing Data
Pushing Data
Pushing Data
Pulling Data
Pulling Data
Offline
Offline
Offline
Offline
Cloud security and benefits with
device-level performance
Only pull what’s needed
Consistent data between devicesConsistent data between users
Benefits
Demo
Resuming Upload of Pending Edits
Check SyncContext
PendingOperations
Make use of
background services
Push and pull when it
makes the most sense
Only do large pushes
over Wi-Fi
No need to push data
right away
Lessons Learned
CONFLICT RESOLUTION
Resilient Apps with Azure Mobile App Services
Conflicts…
Conflicts…
VersionDeleted
UpdatedAtCreatedAtId
How Can Zumo Tell?
On push, Zumo takes
care of updating
Maintained on serverByte array
Version Column
Hybrid – combo of
server and client data
Client winsServer wins
3 Possible Conflict Outcomes
One source of truth
Consistent and
reliable data
People not fighting 
Benefits
Demo
Handling Conflict
Don’t ask the user if their data
should win
Different exceptions for offline push
vs. connected push
Never mess with the Version fieldPush shared data ASAP
Lessons Learned
PURGE & REFRESH
Resilient Apps with Azure Mobile App Services
Want to get back to seed data?Weird behavior / bad data in dev?
Purge and Refresh
Reseed app with test dataProvide users ability to clear cache
Server schema changes –> refresh
client data
Great during development – erase
test data & start over
Benefits
var query = syncTable.CreateQuery()
.Where(st => !st.SeedData);
syncTable.PurgeAsync(”seed_query", query, true, null);
 Create a query that defines data to
purge
 Run “PurgeAsync” to delete data
 First parameter resets incremental
sync query for all pulls
 3rd parameter “forces” delete even
with pending operations
Seriously, do it super earlyDo it early in the dev cycle
Lessons Learned
SILENT DATA PUSH
Resilient Apps with Azure Mobile App Services
Silent Push
Can be targeted
Keeps app data up to
date – no interaction
Sent from Hub to all
device types
Benefits
Demo
Silent Push
Don’t be afraid of MessagingCenterAzure Notification Hub templates
WNS not so easySpend time with APNS and Firebase
Lessons Learned
Silent data pushPurge & refresh
Conflict resolutionPushing dataClient-side schemas
Summary
Thank you!
Matthew Soucoup
Sr. Cloud Developer Advocate,
Microsoft
@codemillmatt codemilltech.com matt.soucoup@microsoft.com

Th03 lessons-learned-resilient-apps-mobile-app-services

Editor's Notes

  • #2 Next step after here will be a demo of apps that aren’t good during offline (Lyft, Weather) and those that are (Twitter)
  • #4 Talk about the fact that our apps still need to work even when not in coverage area – just don’t want to display network not available message
  • #5 Make sure to call out India
  • #33 Don’t push data up right away – you decide when it needs to be pushed – no need to be chatty
  • #41 Do a hybrid demo – figure out a way to determine the winner
  • #42 Different exceptions for offline push => SyncContext vs normal always on connection. May want to show a code slide.
  • #44 Explain that this is mainly for development purposes
  • #51 Do a hybrid demo – figure out a way to determine the winner
  • #54 Next step after here will be a demo of apps that aren’t good during offline (Lyft, Weather) and those that are (Twitter)