when the connection fails

87
When connection fails @basiafusinska basiafusinska.com barbarafusinska.com Going offline on mobile

Upload: barbara-fusinska

Post on 27-Jul-2015

398 views

Category:

Software


2 download

TRANSCRIPT

1. When connection failsGoing offline on [email protected] 2. About [email protected] 3. Agenda Why & when What How Data sync patterns Conflicts resolutions 4. Why do we even need Offline? 5. UX PATTERNS FOROFFLINE APPS 6. Dont lose local data 7. Dont treat offline like an error 8. Dont scare he user 9. Communicate 10. Dont lie 11. Atwoods LawAny application that can bewritten in JavaScript, willeventually be written inJavaScript 12. How to build full offline experience? 13. Cache Retrieving data from anew source Local copy 14. Local databaseHow much data doyou need? 15. Offline is not a problem 16. Offline patterns Cache, Deferred updating Local database sync 17. Online fetchingAPI call 18. Background cachingAPI call 19. PROBLEMS 20. Just in time reportsRun every1 min 21. Offline reports 22. Deferred Updating 23. Twitter API 24. TweetingAPI callstatus: I am so in_reply_to_status_id: null 25. Scenario 1: Store if offlineAPI calldata:{status: I am so in_reply_to_status_id: null}endpoint: updateYESNO 26. Scenario 2: Store always 27. Deferred updatingAPI calldata:{status: I am so in_reply_to_status_id: null}endpoint: updateYESNODelete 28. PROBLEMS 29. External service neededticketDeferred updatingCreateticketUnique IdIdIdIdIdIdBuffer 30. Local Database Sync 31. Full offline experience 32. Problems 33. Data sync 34. Syncing technologieshttp://grasmeyer.com/blog/2013/10/8/a-comparison-of-syncing-technologies 35. Initial sync Data: Client context Timestamped Useful Chosen Paginating 36. Incremental sync 37. GET /endpoint/{timestamp} 38. POST /endpoint {data} 39. How to gather incremental data? 40. Server side CreatedAt UpdateAt DeletedAt 41. Local IsNew IsDirty IsDeleted -> ToBeDeleted 42. Sequential changesCreated & updatedCreated & deletedUpdated & deleted 43. RELATIONS 44. Resolving relations 45. Conflicts 46. Sync new/created data 47. Deleting & relationsA B 48. UpdatefetchServerClienttimestamp (server)timestamp (client)commit 49. DataA: stringB: intC: datetime 50. Files & Documentsfilename: path: type: icon: content: ? 51. Documents content 52. To lose or not to lose 53. Overriding 54. ConflictfetchServerClienttimestamp (server)timestamp (client)commit 55. Accept server changesfetchServerClientcommit 56. Accept local changesfetchServerClientcommit 57. Merging 58. Without conflictA: aB: bC: cfetchA: aB: bC: cServerClientcommitA: aaB: bbC: cA: aB: bC: cCA: aaB: bbC: cC 59. ConflictA: aB: bC: cfetchA: aB: bC: cServerClienttimestamp (server)timestamp (client)commitA: aaB: bbC: cA: aB: bBC: cC 60. Accept server changesA: aB: bC: cfetchA: aB: bC: cServerClientcommitA: aaB: bbC: cA: aB: bBC: cCA: aaB: bbC: cC 61. Accept local changesA: aB: bC: cfetchA: aB: bC: cServerClientcommitA: aaB: bbC: cA: aB: bBC: cCA: aaB: bBC: cC 62. Keeping data 63. ConflictfetchServerClientcommit 64. ConflictA: aB: bC: cfetchA: aB: bC: cServerClientcommitA: aaB: bbC: cA: aB: bBC: cC 65. Ask the userConflict 66. Conflict merge in Git 67. Store conflict dataStore conflict 68. Documents copies 69. What to do then? 70. Summary Full offline experience Data sync Conflict resolution 71. [email protected]