SlideShare une entreprise Scribd logo
1  sur  107
Télécharger pour lire hors ligne
Sync or Swim:
The Challenge of Complex Offline
Apps
Technical Webinar
Sync or Swim
The Challenge of Complex Offline Apps
With Bruno Martinho from OutSystems FE & Mobile
February 14th
2PM (GMT) / 9AM (EDT) / 10PM (SGT)
goo.gl/NsIsq7 Ricardo Ferreira
R & D
@ OutSystems
So...
• You have decided to develop offline apps
• You are aware that things might get complicated
• You know that now is time to “Sync or Swim”
5
BE PREPARED...
Design Offline-First
How Would Your App Work Without Internet Connection?
6
Design Offline-First
7
Features
• What?
• When?
• How?
“Measure twice, cut once”
Data
Synchronization:
What?
8
“Measure twice, cut once”
Data
● Define the subset of data necessary in the device
○ Scope
○ Range
● Redefine the data structure in the device
Common Pitfalls
● Don’t blindly accept: “all data must be on device”
● Don’t blindly accept: “all data must be on device”
When?
9
“Measure twice, cut once”
Data
● Define when data should be synched with the server
○ Device to Server
○ Server to Device
● Define the frequency of each entity
Common Pitfalls
● Trying to always sync all data, even when it is not
necessary
How?
10
● No Silver Bullets
● Depends on business requirements
● Five common patterns:
○ Read-only
○ Read-only (optimized)
○ Read-write, last wins
○ Read-write, conflict resolution
○ Read-write, one-to-many
Data sync is a huge challenge on offline apps:
One of the patterns;
More than one pattern;
None of these patterns.
The solution for your own use case might be:
“Measure seven times, cut once” - Russian version
How Sync Works
Quick Overview of What We Have in OutSystems 10
11
Disclaimer: We’re Teaching You How To Fish
12
How To Set Up Offline
13
Just create a mobile app:
How To Set Up Offline
14
Data Sync Flow
15
t
trigger
sync
start
end / error
sync
sync process
asynchronous
OfflineDataSyncEvents
16
● Block that is automatically placed inside the layout
● Raise 3 events:
○ OnSyncStart - when the sync process starts
○ OnSyncComplete - when the sync process is
sucessfull
○ OnSyncError - when the sync process has an
error
Client Actions
17
● OfflineDataSyncConfiguration - allows to configure the
behavior of the sync process and trigger it automatically
in some occasions:
○ SyncOnOnline - Indicates if a sync process runs when the app is offline and
changes to online
○ SyncOnLogin - Indicates if a sync process runs when the login action is success
○ SyncOnResume - Indicates if a sync process runs when the user resumes the
application from background
○ RetryOnError - Indicated whether to retry in case of an error
○ RetryIntervalInSeconds - Indicates the interval to wait before the next retry
Client Actions
18
● OfflineDataSync - This action should have the logic to get the data from the device,
send it to the server and receive a response. With the response it may change the
local database with the server information.
● TriggerOfflineDataSync - Call this action whenever is necessary to create a manual
sync.
Common Pitfall
● When triggering manually a sync process, calling OfflineDataSync
instead of TriggerOfflineDataSync
Server Actions
19
● Use the server action to create the logic to sync information received from the
device in the server’s database
● The server action should be protected by checking if the user is authenticated. This
is a good practice for security reasons.
Sync Data Patterns
The Fantastic “Five”
20
Five Data Sync Patterns
21
● Read-Only
● Read-Only (Optimized)
● Read-Write, Last Wins
● Read-Write, Conflict Resolution
● Read-Write, One-to-Many
Unidirectional Data Flow
Bidirectional Data Flow
Five Data Sync Patterns
22
To help explaining each pattern, we are now featuring some well-known “Sink or
Swim” experts (fortunately more “swim” than “sink”)
Robinson Crusoe Chuck Noland Jack Sparrow not Titanic Jack...
Five Data Sync Patterns
23
The OutSystems Forge has an app with a collection of offline data synchronization
patterns that we will use during this webinar
Read-Only Data
24
Recommended for mobile apps where end users only need to read data while the
apps are offline and the amount of data is small.
● Local database doesn’t send data to the server
● Server data is Master
● For example, a Product Catalog App
● Has an accelerator in OutSystems Service Studio:
Sync Data A
Read-Only Data
25
ID Name
1 Robinson Crusoe
2 Chuck Noland
ID Name
1 Robinson Crusoe
2 Chuck Noland
3 Jack Sparrow
1. Get data from server
2. Delete all data from local device
3. Write all data received from server
1 Robinson Crusoe
2 Chuck Noland
3 Jack Sparrow
Read-Only Data
26
1. Get data from server 1
Read-Only Data
27
1. Get data from server
2. Delete all data from local device
2
Read-Only Data
28
1. Get data from server
2. Delete all data from local device
3. Write all data received from server
3
Read-Only Data (Optimized)
29
Recommended for mobile apps where end users only need to read data while the
apps are offline and the amount of data is small.
● Local database only sends timestamp to the server
● Server data is master
● Downloads less information from server
Sync Data
ALast Sync Date
Server entity data model:
● Last update date
● Soft delete field
Read-Only Data (optimized)
30
ID Name
1 Crusoe
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
Read-Only Data (optimized)
31
ID Name
1 Crusoe
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
1. Get device last sync date
Yesterday
Read-Only Data (optimized)
32
ID Name
1 Crusoe
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
1. Get device last sync date
Yesterday
2. Get modified and deleted in server
since last sync date UPDATED
DELETED
Read-Only Data (optimized)
33
ID Name
1 Robinson
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
1. Get device last sync date
Yesterday
2. Get modified and deleted in server
since last sync date UPDATED
DELETED
3. Insert or update modified in device
Read-Only Data (optimized)
34
ID Name
1 Robinson
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
1. Get device last sync date
Yesterday
2. Get modified and deleted in server
since last sync date UPDATED
DELETED
3. Insert or update modified in device
4. Delete in device the deleted rows in
the server
Read-Only Data (optimized)
35
ID Name
1 Robinson
2 Chuck Noland
3 Jack Sparrow
ID Name Modified Active
1 Robinson Today True
2 Chuck Noland 1 week True
3 Jack Sparrow Today False
1. Get device last sync date
2. Get modified and deleted in server
since last sync date UPDATED
DELETED
3. Insert or update modified in device
5. Update last sync date
Now
4. Delete in device the deleted rows in
the server
Read-Only Data (optimized)
36
1. Get device last sync date
1
Read-Only Data (optimized)
37
2. Get modified and deleted in server
since last sync date
1. Get device last sync date
2
Read-Only Data (optimized)
38
2. Get modified and deleted in server
since last sync date
1. Get device last sync date
33. Insert or update modified in device
Read-Only Data (optimized)
39
2. Get modified and deleted in server
since last sync date
1. Get device last sync date
4
3. Insert or update modified in device
4. Delete in device the deleted rows in
the server
Read-Only Data (optimized)
40
2. Get modified and deleted in server
since last sync date
1. Get device last sync date
3. Insert or update modified in device
5. Update last sync date
5
4. Delete in device the deleted rows in
the server
Read-Write, Last Wins
41
Recommended for mobile apps where it is not likely for multiple end users to change
the same data while the apps are offline.
● Local database change and sends data to the server
● Data in server is always overridable
● E.g., a Field Services App
● Has an accelerator in Service Studio:
A
A
1
A1
A
A2
A => A1 => A2
Read-Write, Last Wins
42
ID Name
1 Crusoe
2 Chuck Noland
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
Read-Write, Last Wins
43
ID Name
1 Crusoe
2 Chuck Noland
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
1. Check local data for new, updated
and deleted
UPDATED
DELETE
NEW
Read-Write, Last Wins
44
ID Name
1 Robinson
2 Chuck Noland
3 Jack Sparrow
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
UPDATED
DELETE
NEW
Read-Write, Last Wins
45
ID Name
1 Robinson
3 Jack Sparrow
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
UPDATED
DELETE
NEW
3. Get all data from server
Read-Write, Last Wins
46
ID Name
1 Robinson
3 Jack Sparrow
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
3. Get all data from server
4. Delete all data in device
Read-Write, Last Wins
47
ID Name
1 Robinson
3 Jack Sparrow
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
3. Get all data from server
4. Delete all data in device
5. Write all data from server in the
device
1 Robinson True False True
3 Jack Sparrow True False True
Read-Write, Last Wins
48
1. Check local data for new, updated
and deleted
1
Read-Write, Last Wins
49
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
2
Read-Write, Last Wins
50
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
3. Get all data from server
3
Read-Write, Last Wins
51
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
3. Get all data from server
4. Delete all data in device
4
Read-Write, Last Wins
52
2. On server, create, update and delete
data
1. Check local data for new, updated
and deleted
3. Get all data from server
4. Delete all data in device
5. Write all data from server in the
device
5
Read-Write with Conflict Detection
53
Recommended for advanced scenarios where multiple end-users will change the
same data while the apps are offline
● Local database change and sends data to the server
● Data in server has conflict and need to be resolved
● E.g Field Services App with collaboration
● New an entity in device to store conflicts
A
A
1
A1
A
A2
A => A1 ???
A2 ???
Server entity data model:
● Last update date
● Soft delete field
Read-Write with Conflict Detection
54
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
1. Only allow sync if no data in device is
marked as conflict
Read-Write with Conflict Detection
55
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
1 Month
Read-Write with Conflict Detection
56
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
1 Month
3. Get local device data for new, update
and delete UPDATED
DELETE
NEW
Read-Write with Conflict Detection
57
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
1 Month
3. Get local device data for new, update
and delete UPDATED
DELETE
NEW
4. On server, create new data
Read-Write with Conflict Detection
58
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
1 Month
3. Get local device data for new, update
and delete UPDATED
DELETE
NEW
4. On server, create new data
5. Update rows with modified date
before last sync. Others will be marked
as conflict
Read-Write with Conflict Detection
59
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
1 Month
3. Get local device data for new, update
and delete UPDATED
DELETE
NEW
4. On server, create new data
5. Update rows with modified date
before last sync. Others will be marked
as conflict
6. Delete rows with modified date
before last sync. Others will be marked
as conflict
Read-Write with Conflict Detection
60
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
1 Month
UPDATED
DELETE
NEW
N
ow
Read-Write with Conflict Detection
61
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
1 Month
UPDATED
DELETE
NEW
N
ow
ID Name
1 Crusoe
Conflict
9. Delete data from local
Read-Write with Conflict Detection
62
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
1 Month
Now
N
ow
ID Name
1 Crusoe
Conflict
9. Delete data from local
Read-Write with Conflict Detection
63
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
1 Month
10. Write data on the device received
from server, except for conflict. With
conflicts keep the local data
ID Name
1 Crusoe
Conflict
1 Robinson True True True
3 Jack Sparrow True False True
9. Delete data from local
Read-Write with Conflict Detection
64
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
Now
10. Write data on the device received
from server, except for conflict. With
conflicts keep the local data
11. Update last sync date
ID Name
1 Crusoe
Conflict
1 Robinson True True True
3 Jack Sparrow True False True
9. Delete data from local
Read-Write with Conflict Detection
65
ID Name Server Modified Active
1 Robinson True True True
2 Chuck Noland True False False
3 Jack Sparrow False True True
ID Name Modified Active
1 Crusoe Yesterday True
2 Chuck Noland 1 year True
3 Jack Sparrow Now True
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
Now
10. Write data on the device received
from server, except for conflict. With
conflicts keep the local data
11. Update last sync date
ID Name
1 Crusoe
Conflict
1 Robinson True True True
3 Jack Sparrow True False True
12. Show conflicts to solve
DEMO
Conflict Detection
Read-Write with Conflict Detection
67
1
1. Only allow sync if no data in device is
marked as conflict
Read-Write with Conflict Detection
68
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
2
Read-Write with Conflict Detection
69
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
3. Get local device data for new, update
and delete
3
Read-Write with Conflict Detection
70
4
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
3. Get local device data for new, update
and delete
4. On server, create new data
Read-Write with Conflict Detection
71
5
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
3. Get local device data for new, update
and delete
4. On server, create new data
5. Update rows with modified date
before last sync. Others will be marked
as conflict
Read-Write with Conflict Detection
72
6
1. Only allow sync if no data in device is
marked as conflict
2. Get last sync date from device
3. Get local device data for new, update
and delete
4. On server, create new data
5. Update rows with modified date
before last sync. Others will be marked
as conflict
6. Delete rows with modified date
before last sync. Others will be marked
as conflict
Read-Write with Conflict Detection
73
7
7. Return from server last sync date and
two lists, conflicts and no-conflicts
Read-Write with Conflict Detection
74
8
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
Read-Write with Conflict Detection
75
9. Delete data from local
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
9
Read-Write with Conflict Detection
76
10
9. Delete data from local
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
10. Write data on the device received
from server, except for conflict. With
conflicts keep the local data
Read-Write with Conflict Detection
77
9. Delete data from local
7. Return from server last sync date and
two lists, conflicts and no-conflicts
8. Add the ones with conflict to the
conflict table
10. Write data on the device received
from server, except for conflict. With
conflicts keep the local data
11. Update last sync date
11
Read-Write, One-to-Many Data
78
Recommended for mobile apps with entities that follow a one-to-many relationship
and where it is not likely for multiple end users to change the same data while the
apps are offline.
● Local database changes and sends data with relationships to the server.
● Data in server is always overridable.
A, B
A1, B1
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
79
ID Name
1 Robinson Crusoe
2 Jack Sparrow
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
80
ID Name
1 Robinson Crusoe
2 Jack Sparrow
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
1. Check local data on primary table for
new, updated and deleted
NEW
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
81
ID Name
1 Robinson Crusoe
2 Jack Sparrow
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
NEW
NEW
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
82
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data NEW
NEW
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
83
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data
4. Create dictionary with primary Ids
NEW
NEW
Dictionary
ID NewID
2 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
84
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data
4. Create dictionary with primary Ids
5. Update rows received from device
with the new ids in the dictionary
NEW
NEW
Dictionary
ID NewID
2 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
85
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
NEW
NEW
Dictionary
ID NewID
2 3
ID Name CastId
1 Wilson 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
86
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
NEW
NEW
ID Name CastId
1 Wilson 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
87
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
NEW
ID Name CastId
1 Wilson 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
88
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
9. Delete the primary entity in the
device ID Name CastId
1 Wilson 3
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
89
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
9. Delete the primary entity in the
device
10. Add all data for primary entity
received from the server
ID Name CastId
1 Wilson 3
1 Robinson Crusoe True False True
2 Jack Sparrow True False True
3 Chuck Noland True False True
ID Name Server Modified Active
1 Robinson Crusoe True False True
2 Chuck Noland False True True
3 Jack Sparrow True False True
Read-Write, One-to-Many Data
90
ID Name
1 Robinson Crusoe
2 Jack Sparrow
3 Chuck Noland
ID Name CastId Server Modified Active
1 Wilson 2 False True True
Friend
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
9. Delete the primary entity in the
device
10. Add all data for primary entity
received from the server
ID Name CastId
1 Wilson 3
1 Robinson Crusoe True False True
2 Jack Sparrow True False True
3 Chuck Noland True False True
11. Add all data for foreign entity
received from the server
1 Wilson 3 True False True
Read-Write, One-to-Many Data
91
1
1. Check local data on primary table for
new, updated and deleted
Read-Write, One-to-Many Data
92
2
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
Read-Write, One-to-Many Data
93
3
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data
Read-Write, One-to-Many Data
94
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data
4. Create dictionary with primary Ids
4
Read-Write, One-to-Many Data
95
1. Check local data on primary table for
new, updated and deleted
2. Check local data on foreign table
for new, updated and deleted
3. On server, create new data
4. Create dictionary with primary Ids
5. Update rows received from device
with the new ids in the dictionary
5
Read-Write, One-to-Many Data
96
6. Add, update and delete foreign entity
in the server
3
Read-Write, One-to-Many Data
97
7
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
Read-Write, One-to-Many Data
98
8,10
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
9. Delete the primary entity in the
device
10. Add all data for primary entity
received from the server
Read-Write, One-to-Many Data
99
9,11
6. Add, update and delete foreign entity
in the server
7. Send both entities to the device
8. Delete the foreign entity in the
device
9. Delete the primary entity in the
device
10. Add all data for primary entity
received from the server
11. Add all data for foreign entity
received from the server
Summary
• Mobile Apps need offline support to deliver the best user experience.
• Design Offline-First:
○ What features or capabilities should be available offline?
○ What data do you need to store in the device database?
○ When should the data be synchronized?
○ How will you handle data in the device?
• OutSystems 10 makes building Offline Apps a walk in the park:
○ Easy offline data manipulation.
○ Out-of-the-box data synchronization patterns.
10
0
Further reading
Further Reading
10
2
https://goo.gl/40Qc3I
Further Reading
10
3
https://goo.gl/ovqUAX
Links
Links
• Offline Data Synchronization Patterns samples https://goo.gl/ISDsgf
• Offline Data Synchronization Patterns documentation https://goo.gl/By3xNH
• Ciphered Local Storage Plugin https://goo.gl/Tj02P0
10
5
Thank you!
www.outsystems.com10
7

Contenu connexe

Tendances

CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystemsRuben Goncalves
 
Building CRUD Wrappers
Building CRUD WrappersBuilding CRUD Wrappers
Building CRUD WrappersOutSystems
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365OutSystems
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsOutSystems
 
Branching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionBranching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionOutSystems
 
Accessibility with OutSystems
Accessibility with OutSystemsAccessibility with OutSystems
Accessibility with OutSystemsBruno Marcelino
 
OutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems
 
OutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideOutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideDaniel Reis
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems InstallationOutSystems
 
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsTechnical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsOutSystems
 
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...OutSystems
 
Speed up your XPages Application performance
Speed up your XPages Application performanceSpeed up your XPages Application performance
Speed up your XPages Application performanceMaarga Systems
 
Architecture OutSystems Security Specialization - Study Help Deck
Architecture  OutSystems Security Specialization - Study Help DeckArchitecture  OutSystems Security Specialization - Study Help Deck
Architecture OutSystems Security Specialization - Study Help DeckFábio Godinho
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + LibrariesOutSystems
 
Caching Data in OutSystems: A Tale of Gains Without Pain
Caching Data in OutSystems: A Tale of Gains Without PainCaching Data in OutSystems: A Tale of Gains Without Pain
Caching Data in OutSystems: A Tale of Gains Without PainCatarinaPereira64715
 
Hardcore CSS Made Easy
Hardcore CSS Made EasyHardcore CSS Made Easy
Hardcore CSS Made EasyJosé Rosário
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksOutSystems
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
0 to 60 With Outsystems
0 to 60 With Outsystems0 to 60 With Outsystems
0 to 60 With OutsystemsOutSystems
 
Training Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingTraining Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingOutSystems
 

Tendances (20)

CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
 
Building CRUD Wrappers
Building CRUD WrappersBuilding CRUD Wrappers
Building CRUD Wrappers
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystems
 
Branching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionBranching Your Way to Low-Code Perfection
Branching Your Way to Low-Code Perfection
 
Accessibility with OutSystems
Accessibility with OutSystemsAccessibility with OutSystems
Accessibility with OutSystems
 
OutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI Integrations
 
OutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style GuideOutSystems Webinar - Building a Live Style Guide
OutSystems Webinar - Building a Live Style Guide
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsTechnical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
 
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
Automating Your Way to Greatness by Combining OutSystems CI/CD With the Power...
 
Speed up your XPages Application performance
Speed up your XPages Application performanceSpeed up your XPages Application performance
Speed up your XPages Application performance
 
Architecture OutSystems Security Specialization - Study Help Deck
Architecture  OutSystems Security Specialization - Study Help DeckArchitecture  OutSystems Security Specialization - Study Help Deck
Architecture OutSystems Security Specialization - Study Help Deck
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + Libraries
 
Caching Data in OutSystems: A Tale of Gains Without Pain
Caching Data in OutSystems: A Tale of Gains Without PainCaching Data in OutSystems: A Tale of Gains Without Pain
Caching Data in OutSystems: A Tale of Gains Without Pain
 
Hardcore CSS Made Easy
Hardcore CSS Made EasyHardcore CSS Made Easy
Hardcore CSS Made Easy
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous Tasks
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
0 to 60 With Outsystems
0 to 60 With Outsystems0 to 60 With Outsystems
0 to 60 With Outsystems
 
Training Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingTraining Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed caching
 

Similaire à Sync or swim: the challenge of complex offline apps

Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
Stream processing with Apache Flink - Maximilian Michels Data Artisans
Stream processing with Apache Flink - Maximilian Michels Data ArtisansStream processing with Apache Flink - Maximilian Michels Data Artisans
Stream processing with Apache Flink - Maximilian Michels Data ArtisansEvention
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Demi Ben-Ari
 
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Codemotion
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Codemotion
 
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Demi Ben-Ari
 
Corporate Secret Challenge - CyberDefenders.org by Azad
Corporate Secret Challenge - CyberDefenders.org by AzadCorporate Secret Challenge - CyberDefenders.org by Azad
Corporate Secret Challenge - CyberDefenders.org by AzadAzad Mzuri
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017Demi Ben-Ari
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationwebhostingguy
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationwebhostingguy
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your NetworkCTruncer
 
SysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security RemoverSysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security RemoverSysInfoTools Software
 
DevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More DefectsDevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More DefectsTechWell
 
Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210raman pattanaik
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first designKyrylo Reznykov
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeDamien Garros
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelDaniel Coupal
 
Country domination - Causing chaos and wrecking havoc
Country domination - Causing chaos and wrecking havocCountry domination - Causing chaos and wrecking havoc
Country domination - Causing chaos and wrecking havocTiago Henriques
 

Similaire à Sync or swim: the challenge of complex offline apps (20)

Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Stream processing with Apache Flink - Maximilian Michels Data Artisans
Stream processing with Apache Flink - Maximilian Michels Data ArtisansStream processing with Apache Flink - Maximilian Michels Data Artisans
Stream processing with Apache Flink - Maximilian Michels Data Artisans
 
Big Data Warsaw
Big Data WarsawBig Data Warsaw
Big Data Warsaw
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
 
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
 
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems "Done the simple way" - Demi Ben-Ari - Codemotion...
 
Corporate Secret Challenge - CyberDefenders.org by Azad
Corporate Secret Challenge - CyberDefenders.org by AzadCorporate Secret Challenge - CyberDefenders.org by Azad
Corporate Secret Challenge - CyberDefenders.org by Azad
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Berlin 2017
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your Network
 
Flink. Pure Streaming
Flink. Pure StreamingFlink. Pure Streaming
Flink. Pure Streaming
 
SysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security RemoverSysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security Remover
 
DevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More DefectsDevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More Defects
 
Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210
 
Raising ux bar with offline first design
Raising ux bar with offline first designRaising ux bar with offline first design
Raising ux bar with offline first design
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
 
Country domination - Causing chaos and wrecking havoc
Country domination - Causing chaos and wrecking havocCountry domination - Causing chaos and wrecking havoc
Country domination - Causing chaos and wrecking havoc
 

Plus de OutSystems

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaOutSystems
 
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyOutSystems
 
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...OutSystems
 
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutOutSystems
 
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...OutSystems
 
Fast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationOutSystems
 
What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?OutSystems
 
Enrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersOutSystems
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensOutSystems
 
Service Actions
Service ActionsService Actions
Service ActionsOutSystems
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseOutSystems
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best PracticesOutSystems
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintOutSystems
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic InnovationOutSystems
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceOutSystems
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...OutSystems
 
Neo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectNeo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectOutSystems
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsOutSystems
 
Link Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksLink Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksOutSystems
 

Plus de OutSystems (20)

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
 
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
 
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
 
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
 
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
 
Fast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical Application
 
What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?
 
Enrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With Layers
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class Citizens
 
Service Actions
Service ActionsService Actions
Service Actions
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design Sprint
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic Innovation
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard Performance
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
 
Neo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectNeo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems Architect
 
Measure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile ApplicationsMeasure Customer Experience of Your OutSystems Web and Mobile Applications
Measure Customer Experience of Your OutSystems Web and Mobile Applications
 
Link Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With DeeplinksLink Users to Your Specific Page in a Mobile App With Deeplinks
Link Users to Your Specific Page in a Mobile App With Deeplinks
 

Dernier

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 

Dernier (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 

Sync or swim: the challenge of complex offline apps

  • 1. Sync or Swim: The Challenge of Complex Offline Apps
  • 2. Technical Webinar Sync or Swim The Challenge of Complex Offline Apps With Bruno Martinho from OutSystems FE & Mobile February 14th 2PM (GMT) / 9AM (EDT) / 10PM (SGT)
  • 3.
  • 5. So... • You have decided to develop offline apps • You are aware that things might get complicated • You know that now is time to “Sync or Swim” 5 BE PREPARED...
  • 6. Design Offline-First How Would Your App Work Without Internet Connection? 6
  • 7. Design Offline-First 7 Features • What? • When? • How? “Measure twice, cut once” Data Synchronization:
  • 8. What? 8 “Measure twice, cut once” Data ● Define the subset of data necessary in the device ○ Scope ○ Range ● Redefine the data structure in the device Common Pitfalls ● Don’t blindly accept: “all data must be on device” ● Don’t blindly accept: “all data must be on device”
  • 9. When? 9 “Measure twice, cut once” Data ● Define when data should be synched with the server ○ Device to Server ○ Server to Device ● Define the frequency of each entity Common Pitfalls ● Trying to always sync all data, even when it is not necessary
  • 10. How? 10 ● No Silver Bullets ● Depends on business requirements ● Five common patterns: ○ Read-only ○ Read-only (optimized) ○ Read-write, last wins ○ Read-write, conflict resolution ○ Read-write, one-to-many Data sync is a huge challenge on offline apps: One of the patterns; More than one pattern; None of these patterns. The solution for your own use case might be: “Measure seven times, cut once” - Russian version
  • 11. How Sync Works Quick Overview of What We Have in OutSystems 10 11
  • 12. Disclaimer: We’re Teaching You How To Fish 12
  • 13. How To Set Up Offline 13 Just create a mobile app:
  • 14. How To Set Up Offline 14
  • 15. Data Sync Flow 15 t trigger sync start end / error sync sync process asynchronous
  • 16. OfflineDataSyncEvents 16 ● Block that is automatically placed inside the layout ● Raise 3 events: ○ OnSyncStart - when the sync process starts ○ OnSyncComplete - when the sync process is sucessfull ○ OnSyncError - when the sync process has an error
  • 17. Client Actions 17 ● OfflineDataSyncConfiguration - allows to configure the behavior of the sync process and trigger it automatically in some occasions: ○ SyncOnOnline - Indicates if a sync process runs when the app is offline and changes to online ○ SyncOnLogin - Indicates if a sync process runs when the login action is success ○ SyncOnResume - Indicates if a sync process runs when the user resumes the application from background ○ RetryOnError - Indicated whether to retry in case of an error ○ RetryIntervalInSeconds - Indicates the interval to wait before the next retry
  • 18. Client Actions 18 ● OfflineDataSync - This action should have the logic to get the data from the device, send it to the server and receive a response. With the response it may change the local database with the server information. ● TriggerOfflineDataSync - Call this action whenever is necessary to create a manual sync. Common Pitfall ● When triggering manually a sync process, calling OfflineDataSync instead of TriggerOfflineDataSync
  • 19. Server Actions 19 ● Use the server action to create the logic to sync information received from the device in the server’s database ● The server action should be protected by checking if the user is authenticated. This is a good practice for security reasons.
  • 20. Sync Data Patterns The Fantastic “Five” 20
  • 21. Five Data Sync Patterns 21 ● Read-Only ● Read-Only (Optimized) ● Read-Write, Last Wins ● Read-Write, Conflict Resolution ● Read-Write, One-to-Many Unidirectional Data Flow Bidirectional Data Flow
  • 22. Five Data Sync Patterns 22 To help explaining each pattern, we are now featuring some well-known “Sink or Swim” experts (fortunately more “swim” than “sink”) Robinson Crusoe Chuck Noland Jack Sparrow not Titanic Jack...
  • 23. Five Data Sync Patterns 23 The OutSystems Forge has an app with a collection of offline data synchronization patterns that we will use during this webinar
  • 24. Read-Only Data 24 Recommended for mobile apps where end users only need to read data while the apps are offline and the amount of data is small. ● Local database doesn’t send data to the server ● Server data is Master ● For example, a Product Catalog App ● Has an accelerator in OutSystems Service Studio: Sync Data A
  • 25. Read-Only Data 25 ID Name 1 Robinson Crusoe 2 Chuck Noland ID Name 1 Robinson Crusoe 2 Chuck Noland 3 Jack Sparrow 1. Get data from server 2. Delete all data from local device 3. Write all data received from server 1 Robinson Crusoe 2 Chuck Noland 3 Jack Sparrow
  • 26. Read-Only Data 26 1. Get data from server 1
  • 27. Read-Only Data 27 1. Get data from server 2. Delete all data from local device 2
  • 28. Read-Only Data 28 1. Get data from server 2. Delete all data from local device 3. Write all data received from server 3
  • 29. Read-Only Data (Optimized) 29 Recommended for mobile apps where end users only need to read data while the apps are offline and the amount of data is small. ● Local database only sends timestamp to the server ● Server data is master ● Downloads less information from server Sync Data ALast Sync Date Server entity data model: ● Last update date ● Soft delete field
  • 30. Read-Only Data (optimized) 30 ID Name 1 Crusoe 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False
  • 31. Read-Only Data (optimized) 31 ID Name 1 Crusoe 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False 1. Get device last sync date Yesterday
  • 32. Read-Only Data (optimized) 32 ID Name 1 Crusoe 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False 1. Get device last sync date Yesterday 2. Get modified and deleted in server since last sync date UPDATED DELETED
  • 33. Read-Only Data (optimized) 33 ID Name 1 Robinson 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False 1. Get device last sync date Yesterday 2. Get modified and deleted in server since last sync date UPDATED DELETED 3. Insert or update modified in device
  • 34. Read-Only Data (optimized) 34 ID Name 1 Robinson 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False 1. Get device last sync date Yesterday 2. Get modified and deleted in server since last sync date UPDATED DELETED 3. Insert or update modified in device 4. Delete in device the deleted rows in the server
  • 35. Read-Only Data (optimized) 35 ID Name 1 Robinson 2 Chuck Noland 3 Jack Sparrow ID Name Modified Active 1 Robinson Today True 2 Chuck Noland 1 week True 3 Jack Sparrow Today False 1. Get device last sync date 2. Get modified and deleted in server since last sync date UPDATED DELETED 3. Insert or update modified in device 5. Update last sync date Now 4. Delete in device the deleted rows in the server
  • 36. Read-Only Data (optimized) 36 1. Get device last sync date 1
  • 37. Read-Only Data (optimized) 37 2. Get modified and deleted in server since last sync date 1. Get device last sync date 2
  • 38. Read-Only Data (optimized) 38 2. Get modified and deleted in server since last sync date 1. Get device last sync date 33. Insert or update modified in device
  • 39. Read-Only Data (optimized) 39 2. Get modified and deleted in server since last sync date 1. Get device last sync date 4 3. Insert or update modified in device 4. Delete in device the deleted rows in the server
  • 40. Read-Only Data (optimized) 40 2. Get modified and deleted in server since last sync date 1. Get device last sync date 3. Insert or update modified in device 5. Update last sync date 5 4. Delete in device the deleted rows in the server
  • 41. Read-Write, Last Wins 41 Recommended for mobile apps where it is not likely for multiple end users to change the same data while the apps are offline. ● Local database change and sends data to the server ● Data in server is always overridable ● E.g., a Field Services App ● Has an accelerator in Service Studio: A A 1 A1 A A2 A => A1 => A2
  • 42. Read-Write, Last Wins 42 ID Name 1 Crusoe 2 Chuck Noland ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True
  • 43. Read-Write, Last Wins 43 ID Name 1 Crusoe 2 Chuck Noland ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True 1. Check local data for new, updated and deleted UPDATED DELETE NEW
  • 44. Read-Write, Last Wins 44 ID Name 1 Robinson 2 Chuck Noland 3 Jack Sparrow ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True 2. On server, create, update and delete data 1. Check local data for new, updated and deleted UPDATED DELETE NEW
  • 45. Read-Write, Last Wins 45 ID Name 1 Robinson 3 Jack Sparrow ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True 2. On server, create, update and delete data 1. Check local data for new, updated and deleted UPDATED DELETE NEW 3. Get all data from server
  • 46. Read-Write, Last Wins 46 ID Name 1 Robinson 3 Jack Sparrow ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 3. Get all data from server 4. Delete all data in device
  • 47. Read-Write, Last Wins 47 ID Name 1 Robinson 3 Jack Sparrow ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 3. Get all data from server 4. Delete all data in device 5. Write all data from server in the device 1 Robinson True False True 3 Jack Sparrow True False True
  • 48. Read-Write, Last Wins 48 1. Check local data for new, updated and deleted 1
  • 49. Read-Write, Last Wins 49 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 2
  • 50. Read-Write, Last Wins 50 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 3. Get all data from server 3
  • 51. Read-Write, Last Wins 51 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 3. Get all data from server 4. Delete all data in device 4
  • 52. Read-Write, Last Wins 52 2. On server, create, update and delete data 1. Check local data for new, updated and deleted 3. Get all data from server 4. Delete all data in device 5. Write all data from server in the device 5
  • 53. Read-Write with Conflict Detection 53 Recommended for advanced scenarios where multiple end-users will change the same data while the apps are offline ● Local database change and sends data to the server ● Data in server has conflict and need to be resolved ● E.g Field Services App with collaboration ● New an entity in device to store conflicts A A 1 A1 A A2 A => A1 ??? A2 ??? Server entity data model: ● Last update date ● Soft delete field
  • 54. Read-Write with Conflict Detection 54 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 1. Only allow sync if no data in device is marked as conflict
  • 55. Read-Write with Conflict Detection 55 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 1 Month
  • 56. Read-Write with Conflict Detection 56 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 1 Month 3. Get local device data for new, update and delete UPDATED DELETE NEW
  • 57. Read-Write with Conflict Detection 57 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 1 Month 3. Get local device data for new, update and delete UPDATED DELETE NEW 4. On server, create new data
  • 58. Read-Write with Conflict Detection 58 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 1 Month 3. Get local device data for new, update and delete UPDATED DELETE NEW 4. On server, create new data 5. Update rows with modified date before last sync. Others will be marked as conflict
  • 59. Read-Write with Conflict Detection 59 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 1 Month 3. Get local device data for new, update and delete UPDATED DELETE NEW 4. On server, create new data 5. Update rows with modified date before last sync. Others will be marked as conflict 6. Delete rows with modified date before last sync. Others will be marked as conflict
  • 60. Read-Write with Conflict Detection 60 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 1 Month UPDATED DELETE NEW N ow
  • 61. Read-Write with Conflict Detection 61 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 1 Month UPDATED DELETE NEW N ow ID Name 1 Crusoe Conflict
  • 62. 9. Delete data from local Read-Write with Conflict Detection 62 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 1 Month Now N ow ID Name 1 Crusoe Conflict
  • 63. 9. Delete data from local Read-Write with Conflict Detection 63 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 1 Month 10. Write data on the device received from server, except for conflict. With conflicts keep the local data ID Name 1 Crusoe Conflict 1 Robinson True True True 3 Jack Sparrow True False True
  • 64. 9. Delete data from local Read-Write with Conflict Detection 64 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table Now 10. Write data on the device received from server, except for conflict. With conflicts keep the local data 11. Update last sync date ID Name 1 Crusoe Conflict 1 Robinson True True True 3 Jack Sparrow True False True
  • 65. 9. Delete data from local Read-Write with Conflict Detection 65 ID Name Server Modified Active 1 Robinson True True True 2 Chuck Noland True False False 3 Jack Sparrow False True True ID Name Modified Active 1 Crusoe Yesterday True 2 Chuck Noland 1 year True 3 Jack Sparrow Now True 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table Now 10. Write data on the device received from server, except for conflict. With conflicts keep the local data 11. Update last sync date ID Name 1 Crusoe Conflict 1 Robinson True True True 3 Jack Sparrow True False True 12. Show conflicts to solve
  • 67. Read-Write with Conflict Detection 67 1 1. Only allow sync if no data in device is marked as conflict
  • 68. Read-Write with Conflict Detection 68 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 2
  • 69. Read-Write with Conflict Detection 69 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 3. Get local device data for new, update and delete 3
  • 70. Read-Write with Conflict Detection 70 4 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 3. Get local device data for new, update and delete 4. On server, create new data
  • 71. Read-Write with Conflict Detection 71 5 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 3. Get local device data for new, update and delete 4. On server, create new data 5. Update rows with modified date before last sync. Others will be marked as conflict
  • 72. Read-Write with Conflict Detection 72 6 1. Only allow sync if no data in device is marked as conflict 2. Get last sync date from device 3. Get local device data for new, update and delete 4. On server, create new data 5. Update rows with modified date before last sync. Others will be marked as conflict 6. Delete rows with modified date before last sync. Others will be marked as conflict
  • 73. Read-Write with Conflict Detection 73 7 7. Return from server last sync date and two lists, conflicts and no-conflicts
  • 74. Read-Write with Conflict Detection 74 8 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table
  • 75. Read-Write with Conflict Detection 75 9. Delete data from local 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 9
  • 76. Read-Write with Conflict Detection 76 10 9. Delete data from local 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 10. Write data on the device received from server, except for conflict. With conflicts keep the local data
  • 77. Read-Write with Conflict Detection 77 9. Delete data from local 7. Return from server last sync date and two lists, conflicts and no-conflicts 8. Add the ones with conflict to the conflict table 10. Write data on the device received from server, except for conflict. With conflicts keep the local data 11. Update last sync date 11
  • 78. Read-Write, One-to-Many Data 78 Recommended for mobile apps with entities that follow a one-to-many relationship and where it is not likely for multiple end users to change the same data while the apps are offline. ● Local database changes and sends data with relationships to the server. ● Data in server is always overridable. A, B A1, B1
  • 79. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 79 ID Name 1 Robinson Crusoe 2 Jack Sparrow ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend
  • 80. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 80 ID Name 1 Robinson Crusoe 2 Jack Sparrow ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 1. Check local data on primary table for new, updated and deleted NEW
  • 81. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 81 ID Name 1 Robinson Crusoe 2 Jack Sparrow ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted NEW NEW
  • 82. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 82 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data NEW NEW
  • 83. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 83 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data 4. Create dictionary with primary Ids NEW NEW Dictionary ID NewID 2 3
  • 84. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 84 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data 4. Create dictionary with primary Ids 5. Update rows received from device with the new ids in the dictionary NEW NEW Dictionary ID NewID 2 3
  • 85. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 85 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server NEW NEW Dictionary ID NewID 2 3 ID Name CastId 1 Wilson 3
  • 86. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 86 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server 7. Send both entities to the device NEW NEW ID Name CastId 1 Wilson 3
  • 87. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 87 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device NEW ID Name CastId 1 Wilson 3
  • 88. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 88 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device 9. Delete the primary entity in the device ID Name CastId 1 Wilson 3
  • 89. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 89 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device 9. Delete the primary entity in the device 10. Add all data for primary entity received from the server ID Name CastId 1 Wilson 3 1 Robinson Crusoe True False True 2 Jack Sparrow True False True 3 Chuck Noland True False True
  • 90. ID Name Server Modified Active 1 Robinson Crusoe True False True 2 Chuck Noland False True True 3 Jack Sparrow True False True Read-Write, One-to-Many Data 90 ID Name 1 Robinson Crusoe 2 Jack Sparrow 3 Chuck Noland ID Name CastId Server Modified Active 1 Wilson 2 False True True Friend 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device 9. Delete the primary entity in the device 10. Add all data for primary entity received from the server ID Name CastId 1 Wilson 3 1 Robinson Crusoe True False True 2 Jack Sparrow True False True 3 Chuck Noland True False True 11. Add all data for foreign entity received from the server 1 Wilson 3 True False True
  • 91. Read-Write, One-to-Many Data 91 1 1. Check local data on primary table for new, updated and deleted
  • 92. Read-Write, One-to-Many Data 92 2 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted
  • 93. Read-Write, One-to-Many Data 93 3 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data
  • 94. Read-Write, One-to-Many Data 94 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data 4. Create dictionary with primary Ids 4
  • 95. Read-Write, One-to-Many Data 95 1. Check local data on primary table for new, updated and deleted 2. Check local data on foreign table for new, updated and deleted 3. On server, create new data 4. Create dictionary with primary Ids 5. Update rows received from device with the new ids in the dictionary 5
  • 96. Read-Write, One-to-Many Data 96 6. Add, update and delete foreign entity in the server 3
  • 97. Read-Write, One-to-Many Data 97 7 6. Add, update and delete foreign entity in the server 7. Send both entities to the device
  • 98. Read-Write, One-to-Many Data 98 8,10 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device 9. Delete the primary entity in the device 10. Add all data for primary entity received from the server
  • 99. Read-Write, One-to-Many Data 99 9,11 6. Add, update and delete foreign entity in the server 7. Send both entities to the device 8. Delete the foreign entity in the device 9. Delete the primary entity in the device 10. Add all data for primary entity received from the server 11. Add all data for foreign entity received from the server
  • 100. Summary • Mobile Apps need offline support to deliver the best user experience. • Design Offline-First: ○ What features or capabilities should be available offline? ○ What data do you need to store in the device database? ○ When should the data be synchronized? ○ How will you handle data in the device? • OutSystems 10 makes building Offline Apps a walk in the park: ○ Easy offline data manipulation. ○ Out-of-the-box data synchronization patterns. 10 0
  • 104. Links
  • 105. Links • Offline Data Synchronization Patterns samples https://goo.gl/ISDsgf • Offline Data Synchronization Patterns documentation https://goo.gl/By3xNH • Ciphered Local Storage Plugin https://goo.gl/Tj02P0 10 5