SlideShare a Scribd company logo
1 of 107
Download to read offline
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

More Related Content

What's hot

Training Webinar: Detect Performance Bottlenecks of Applications
Training Webinar: Detect Performance Bottlenecks of ApplicationsTraining Webinar: Detect Performance Bottlenecks of Applications
Training Webinar: Detect Performance Bottlenecks of ApplicationsOutSystems
 
Launching a BPT Process on Entity Update
Launching a BPT Process on Entity UpdateLaunching a BPT Process on Entity Update
Launching a BPT Process on Entity UpdateOutSystems
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystemsOutSystems
 
Service Actions
Service ActionsService Actions
Service ActionsOutSystems
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesOutSystems
 
Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with JavascriptRitaDias72
 
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
 
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystemsRuben Goncalves
 
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
 
Mobile Synchronization Patterns for Large Volumes of Data
Mobile Synchronization Patterns for Large Volumes of DataMobile Synchronization Patterns for Large Volumes of Data
Mobile Synchronization Patterns for Large Volumes of DataOutSystems
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10OutSystems
 
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
 
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
 
Top front-end techniques for OutSystems
Top front-end techniques for OutSystemsTop front-end techniques for OutSystems
Top front-end techniques for OutSystemsRuben Goncalves
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems InstallationOutSystems
 
Growing and Scaling OutSystems
Growing and Scaling OutSystemsGrowing and Scaling OutSystems
Growing and Scaling OutSystemsOutSystems
 
Building frameworks: from concept to completion
Building frameworks: from concept to completionBuilding frameworks: from concept to completion
Building frameworks: from concept to completionRuben Goncalves
 
OutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proOutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proProvidit
 
Accessibility with OutSystems
Accessibility with OutSystemsAccessibility with OutSystems
Accessibility with OutSystemsBruno Marcelino
 

What's hot (20)

Training Webinar: Detect Performance Bottlenecks of Applications
Training Webinar: Detect Performance Bottlenecks of ApplicationsTraining Webinar: Detect Performance Bottlenecks of Applications
Training Webinar: Detect Performance Bottlenecks of Applications
 
Launching a BPT Process on Entity Update
Launching a BPT Process on Entity UpdateLaunching a BPT Process on Entity Update
Launching a BPT Process on Entity Update
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystems
 
Service Actions
Service ActionsService Actions
Service Actions
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
 
Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with Javascript
 
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
 
CSS workshop @ OutSystems
CSS workshop @ OutSystemsCSS workshop @ OutSystems
CSS workshop @ OutSystems
 
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
 
Mobile Synchronization Patterns for Large Volumes of Data
Mobile Synchronization Patterns for Large Volumes of DataMobile Synchronization Patterns for Large Volumes of Data
Mobile Synchronization Patterns for Large Volumes of Data
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10
 
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
 
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
 
Top front-end techniques for OutSystems
Top front-end techniques for OutSystemsTop front-end techniques for OutSystems
Top front-end techniques for OutSystems
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
Growing and Scaling OutSystems
Growing and Scaling OutSystemsGrowing and Scaling OutSystems
Growing and Scaling OutSystems
 
Building frameworks: from concept to completion
Building frameworks: from concept to completionBuilding frameworks: from concept to completion
Building frameworks: from concept to completion
 
OutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a proOutSystems community meetup 2019 03_how to handle exceptions like a pro
OutSystems community meetup 2019 03_how to handle exceptions like a pro
 
Accessibility with OutSystems
Accessibility with OutSystemsAccessibility with OutSystems
Accessibility with OutSystems
 

Similar to 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
 

Similar to 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
 
Big Data Warsaw
Big Data WarsawBig Data Warsaw
Big Data Warsaw
 
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
 
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
 

More from 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
 
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
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseOutSystems
 
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
 
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
 
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
 
Testing With OutSystems
Testing With OutSystemsTesting With OutSystems
Testing With OutSystemsOutSystems
 
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentSetting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentOutSystems
 
Intro to the Data Grid
Intro to the Data GridIntro to the Data Grid
Intro to the Data GridOutSystems
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365OutSystems
 
How to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsHow to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsOutSystems
 

More from 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
 
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
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
 
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
 
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
 
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
 
Testing With OutSystems
Testing With OutSystemsTesting With OutSystems
Testing With OutSystems
 
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail EnvironmentSetting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
Setting up a Tech Innovation Lab in a Traditional Grocery Retail Environment
 
Intro to the Data Grid
Intro to the Data GridIntro to the Data Grid
Intro to the Data Grid
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365
 
How to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive MarketsHow to Attract and Train Talent in Highly Competitive Markets
How to Attract and Train Talent in Highly Competitive Markets
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

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