SlideShare a Scribd company logo
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

Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
OutSystems
 
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureTraining Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
OutSystems
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystems
OutSystems
 
Applications Performance Monitoring with Applications Manager part 1
Applications Performance Monitoring with Applications Manager part 1Applications Performance Monitoring with Applications Manager part 1
Applications Performance Monitoring with Applications Manager part 1
ManageEngine, Zoho Corporation
 
Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with Javascript
RitaDias72
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + Libraries
OutSystems
 
Apache Arrow Flight Overview
Apache Arrow Flight OverviewApache Arrow Flight Overview
Apache Arrow Flight Overview
Jacques Nadeau
 
Hands on With Advanced Data Grid
Hands on With Advanced Data GridHands on With Advanced Data Grid
Hands on With Advanced Data Grid
OutSystems
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help Deck
Fábio Godinho
 
Service Actions
Service ActionsService Actions
Service Actions
OutSystems
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
Damien Dallimore
 
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
OutSystems
 
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
OutSystems
 
Hardcore CSS Made Easy
Hardcore CSS Made EasyHardcore CSS Made Easy
Hardcore CSS Made Easy
José Rosário
 
Fiori for s4 hana troubleshooting tips and tricks
Fiori for s4 hana  troubleshooting tips and tricksFiori for s4 hana  troubleshooting tips and tricks
Fiori for s4 hana troubleshooting tips and tricks
Jasbir Khanuja
 
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
OutSystems
 
SAP API Management and API Business Hub (TechEd Barcelona)
SAP API Management and API Business Hub (TechEd Barcelona)SAP API Management and API Business Hub (TechEd Barcelona)
SAP API Management and API Business Hub (TechEd Barcelona)
Harsh Jegadeesan
 
Data Science Across Data Sources with Apache Arrow
Data Science Across Data Sources with Apache ArrowData Science Across Data Sources with Apache Arrow
Data Science Across Data Sources with Apache Arrow
Databricks
 
Decoding SAP S/4HANA System Conversion
Decoding SAP S/4HANA System ConversionDecoding SAP S/4HANA System Conversion
Decoding SAP S/4HANA System Conversion
Akilesh Kumaran
 
Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patterns
Md. Sadhan Sarker
 

What's hot (20)

Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
 
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureTraining Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystems
 
Applications Performance Monitoring with Applications Manager part 1
Applications Performance Monitoring with Applications Manager part 1Applications Performance Monitoring with Applications Manager part 1
Applications Performance Monitoring with Applications Manager part 1
 
Extending OutSystems with Javascript
Extending OutSystems with JavascriptExtending OutSystems with Javascript
Extending OutSystems with Javascript
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + Libraries
 
Apache Arrow Flight Overview
Apache Arrow Flight OverviewApache Arrow Flight Overview
Apache Arrow Flight Overview
 
Hands on With Advanced Data Grid
Hands on With Advanced Data GridHands on With Advanced Data Grid
Hands on With Advanced Data Grid
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help Deck
 
Service Actions
Service ActionsService Actions
Service Actions
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
 
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
 
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
 
Hardcore CSS Made Easy
Hardcore CSS Made EasyHardcore CSS Made Easy
Hardcore CSS Made Easy
 
Fiori for s4 hana troubleshooting tips and tricks
Fiori for s4 hana  troubleshooting tips and tricksFiori for s4 hana  troubleshooting tips and tricks
Fiori for s4 hana troubleshooting tips and tricks
 
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
 
SAP API Management and API Business Hub (TechEd Barcelona)
SAP API Management and API Business Hub (TechEd Barcelona)SAP API Management and API Business Hub (TechEd Barcelona)
SAP API Management and API Business Hub (TechEd Barcelona)
 
Data Science Across Data Sources with Apache Arrow
Data Science Across Data Sources with Apache ArrowData Science Across Data Sources with Apache Arrow
Data Science Across Data Sources with Apache Arrow
 
Decoding SAP S/4HANA System Conversion
Decoding SAP S/4HANA System ConversionDecoding SAP S/4HANA System Conversion
Decoding SAP S/4HANA System Conversion
 
Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patterns
 

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 @StitchFix
C4Media
 
Big Data Warsaw
Big Data WarsawBig Data Warsaw
Big Data Warsaw
Maximilian Michels
 
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
Evention
 
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 Azad
Azad 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 2017
Demi 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 Network
CTruncer
 
Flink. Pure Streaming
Flink. Pure StreamingFlink. Pure Streaming
Flink. Pure Streaming
Indizen Technologies
 
SysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security RemoverSysInfoTools NSF Local Security Remover
SysInfoTools NSF Local Security Remover
SysInfoTools Software
 
DevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More DefectsDevOps: Find Solutions, Not More Defects
DevOps: Find Solutions, Not More Defects
TechWell
 
Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210Fcm rapid-install-11122-1634210
Fcm rapid-install-11122-1634210
raman 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 design
Kyrylo Reznykov
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
Damien 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 Sequel
Daniel 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 havoc
Tiago 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 Media
OutSystems
 
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
OutSystems
 
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-Out
OutSystems
 
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 Application
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 Layers
OutSystems
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
OutSystems
 
The 4-Layer Architecture in Practice
The 4-Layer Architecture in PracticeThe 4-Layer Architecture in Practice
The 4-Layer Architecture in Practice
OutSystems
 
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
OutSystems
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
OutSystems
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design Sprint
OutSystems
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic Innovation
OutSystems
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard Performance
OutSystems
 
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 Architect
OutSystems
 
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
OutSystems
 
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
OutSystems
 
Testing With OutSystems
Testing With OutSystemsTesting With OutSystems
Testing With OutSystems
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
OutSystems
 

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
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
The 4-Layer Architecture in Practice
The 4-Layer Architecture in PracticeThe 4-Layer Architecture in Practice
The 4-Layer Architecture in Practice
 
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
 
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
 
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
 

Recently uploaded

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

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