Mobile Synchronization Patterns for Large Volumes of Data

OutSystems
OutSystemsCore Marketing Director at OutSystems
|
Mobile Synchronization
Patterns for Large Volumes
of Data
|| Mobile Synchronization Patterns for Large Volumes of Data
João Pereira
Developer | Do iT Lean
@
in
joao.pereira@doilean.com
/joão-pedro-martins-pereira-8a115b120
|| Mobile Synchronization Patterns for Large Volumes of Data
Agenda
| Mobile Synchronization Patterns for Large Volumes of Data
● The Mobile Challenge
● Let’s Recap OutSystems Best Practices
● When We Can’t Follow Best Practices . . .
● Solving the Challenge!
● Patterns in Action
|| Mobile Synchronization Patterns for Large Volumes of Data
The Mobile Challenge
| Mobile Synchronization Patterns for Large Volumes of Data
● Mobile Devices are more powerful
than ever
● Mobile apps are faster and more
intuitive than ever
● Users expect your app to perform
like all other apps they use
● How can we do it with OutSystems?
|| Mobile Synchronization Patterns for Large Volumes of Data
Let’s Recap OutSystems
Best Practices
| Mobile Synchronization Patterns for Large Volumes of Data
1. Lightweight Local Database
● Design the local storage data model using only the attributes
that you need
● Transform the local data model to avoid complex queries like
having multiple JOINS
● Identify the best data synchronization patterns for your use case
and define exactly when to run them
| Mobile Synchronization Patterns for Large Volumes of Data
1.1. Lightweight Local Database Example
Server DB Local DB
| Mobile Synchronization Patterns for Large Volumes of Data
2. Control the Amount of Synchronized Data
● We can control the data fetched from the server using:
■ Sync Unit
■ Local Sync Properties
■ Only get the latest data from the server
■ Only get the data that we really need
| Mobile Synchronization Patterns for Large Volumes of Data
3. SyncUnit - Defining Synchronization Moments
| Mobile Synchronization Patterns for Large Volumes of Data
Makes a sync when the add button is Clicked
4. Use the TriggerOfflineDataSync
Synchronize Data in the Background Without Freezing the UI
| Mobile Synchronization Patterns for Large Volumes of Data
5. Avoid Multiple Server Requests
On Client Actions Consolidate Server Requests into one Action
Client Server
| Mobile Synchronization Patterns for Large Volumes of Data
● Evaluate network requirements use cases
■ Define Local Storage strategy
■ Optimize data sync moments
● Evaluate network status in runtime
■ Adapt behavior accordingly
■ Let the user know what’s happening
6. Control the Network Status
| Mobile Synchronization Patterns for Large Volumes of Data
● Corporate vs Public App
● Multiple types of devices
● Different operating systems (Android, iOS)
7. Fined Tune Data Transfers
|| Mobile Synchronization Patterns for Large Volumes of Data
When We Can’t Follow
Best Practices . . .
| Mobile Synchronization Patterns for Large Volumes of Data
1. Mobile App = Web Version
● Client Demands:
■ Must have same functionality in web and mobile
■ The Mobile App is not going to be built based on
mobile specific use cases but on the web
application
● Developer Challenge
■ Must adapt the best practices to support this
situation
| Mobile Synchronization Patterns for Large Volumes of Data
| Mobile Synchronization Patterns for Large Volumes of Data
● Cannot Create a Lightweight Device
Database
■ Requiring JOIN’s will influence performance of the
app
■ Must find ways to overcome this limitation in
terms of Sync Moments
■ Analyze the use-cases the application needs
■ Minimize sync of tables that have a high volume of
data
■ Minimize using data that have multiple joins on
Mobile App Screens
2. All Data Must Be on the Mobile App
|| Mobile Synchronization Patterns for Large Volumes of Data
Solving the Challenge!
| Mobile Synchronization Patterns for Large Volumes of Data
Controlling
Time & Matter
| Mobile Synchronization Patterns for Large Volumes of Data
● Case A - Infrequent Change
■ Treat like static data
■ Synchronize all in the first use of the
application
■ Sync only when the data changes
■ Inside of the Mobile App only sync the
tables & data that is really needed
1. Understanding Your Data
| Mobile Synchronization Patterns for Large Volumes of Data
● Case B - Frequent Change
■ Like in the previous case - sync all data in first use
■ On Local to Server, only sync the modified data
■ Syncing Modified Data - Depending on the use-
case, choose one of these scenarios
■ Last Write Wins
■ Server Always Win
■ Conflict Mechanism
■ Discard mechanism to prevent inconsistent data if
sync processes went wrong
1. Understanding Your Data
| Mobile Synchronization Patterns for Large Volumes of Data
● SyncUnit
■ Create a static entity with the tables we
need to sync
● Create a Sync Unit History
■ Keep track of tables that need sync
■ Last date the data was changed
2. Build Your Sync Mechanism
|| Mobile Synchronization Patterns for Large Volumes of Data
Patterns in Action
| Mobile Synchronization Patterns for Large Volumes of Data
● Use case – Need to have 3000 records available at the start of the
application:
■ First Use Sync Strategy – Sync all the data - must guaranty the network is 3G or
superior
■ When the tables get changed just synchronize the ones that changed
■ Sync only the data that is needed to execute the functionality that is needed on
the Mobile App
Real World Example
| Mobile Synchronization Patterns for Large Volumes of Data
● Create the SyncUnitHistory Record
■ Will be created on the CRUD – Create or
Update Actions of the tables we want to
sync
■ This table will have SyncUnitId and the Last
Updated Date
■ Used to know the date of the last changed
record of a table that we will need to sync
How to know when and what needs to be Synced?
| Mobile Synchronization Patterns for Large Volumes of Data
● Get SyncUnits To Sync:
■ Action to check which SyncUnits need
to be refreshed on your mobile app
■ Receives the Device Date and returns
the list of ids of the tables that need
to be sync
■ The action is used in the mobile
synchronization action
How to know what tables we need to Sync ?
| Mobile Synchronization Patterns for Large Volumes of Data
● Create a Control of Sync in Local Storage:
■ Sync controller in the local storage
■ This will kept track of the tables that already have
been synced and when it was done
Client-Side LastSync Controller
| Mobile Synchronization Patterns for Large Volumes of Data
Example - MaterialType table
Table with large volume of data
| Mobile Synchronization Patterns for Large Volumes of Data
● Sync of Material Type :
■ Get the Material-Types that are present on
the server
■ In the first time will get all
■ Next time is filter by date from, date to and
only the active ones
■ LocaleId is passed because app is
multilingual
■ As output we get the Server Material Types
and the total records
1. Create Sync Material-Type action
| Mobile Synchronization Patterns for Large Volumes of Data
● Sync of Material Type client side :
■ Create our Material-Type Local Storage;
■ Last Sync table to get the interval of time the
date will be get
■ Updates the controller for the sync unit
Material-Type
2. Action on client side to fill Material-Type local table
| Mobile Synchronization Patterns for Large Volumes of Data
● OfflineDataSync Action :
■ Sync the Local Data into the Server
■ If no errors occur, we start the sync of the
large volume of data tables
■ Sync the tables with less volume of data
3. Mobile synchronization process
| Mobile Synchronization Patterns for Large Volumes of Data
● Sync_LC_Check Action :
■ Check’s our connection because we
need to have network
■ Get SyncUnits to update list to
check which tables need to be sync
■ Update the sync controller Last Sync
and run the action Sync_LC_Update
4. Trigger and know which tables we going to Sync
| Mobile Synchronization Patterns for Large Volumes of Data
● Sync_LC_Update Action :
■ This action will receive as input the
SyncUnit and only update the
respective table
5. Action that Syncs the large volume of data tables
| Mobile Synchronization Patterns for Large Volumes of Data
Dealing with
Conflict
| Mobile Synchronization Patterns for Large Volumes of Data
● Use Case:
■ When multiple users can change the same
data and the mobile app can be used offline
■ You need a mechanism to determine which
data is conflicting
■ You need a screen so the user can choose the
correct data
How to Create a Conflict Screen on Your Mobile App
| Mobile Synchronization Patterns for Large Volumes of Data
● Solution:
■ Create a Static Table with the Entities name that we want to make conflict
detection and resolution
■ Then use that static entity and create one local entity that will keep the table
name and a flag if exist conflict
■ When we try to sync or update the local record into the server we need to check
if a conflict exists
■ If a conflict exists create an entry on the table of conflicts and add a record to
the list
How to Create a Conflict Screen on Your Mobile App
| Mobile Synchronization Patterns for Large Volumes of Data
1. Creating the list of Conflicts
| Mobile Synchronization Patterns for Large Volumes of Data
● Conflict Resolution:
■ After click on the list the Conflict
Element’s will appear
■ Local & Server record are serialize &
deserialize into a JSON
■ Screen less heavy and with better
performance
■ Can be optimized to choose attribute
by attribute instead of record
2. Conflict Screen on Mobile App to Compare Data
| Mobile Synchronization Patterns for Large Volumes of Data
|| Mobile Synchronization Patterns for Large Volumes of Data
Q & A
|
Thank You!
@ injoao.pereira@doilean.com / joão-pedro-martins-
pereira-8a115b120
1 of 43

Recommended

IDM Introduction by
IDM IntroductionIDM Introduction
IDM IntroductionAidy Tificate
5.1K views27 slides
Evolution of MySQL Parallel Replication by
Evolution of MySQL Parallel Replication Evolution of MySQL Parallel Replication
Evolution of MySQL Parallel Replication Mydbops
1.3K views36 slides
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf by
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfAlkin Tezuysal
202 views33 slides
April, 2021 OpenNTF Webinar - Domino Administration Best Practices by
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesApril, 2021 OpenNTF Webinar - Domino Administration Best Practices
April, 2021 OpenNTF Webinar - Domino Administration Best PracticesHoward Greenberg
580 views57 slides
PostgreSQL Administration for System Administrators by
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
7K views28 slides
Design Web Service API by HungerStation by
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStationArabNet ME
1.3K views81 slides

More Related Content

What's hot

FIDO Workshop-Demo Breakdown.pptx by
FIDO Workshop-Demo Breakdown.pptxFIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptxFIDO Alliance
653 views19 slides
MySQL/MariaDB Proxy Software Test by
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestI Goo Lee
2K views16 slides
HTTP - The Other Face Of Domino by
HTTP - The Other Face Of DominoHTTP - The Other Face Of Domino
HTTP - The Other Face Of DominoGabriella Davis
4.3K views59 slides
New awesome features in MySQL 5.7 by
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
1K views77 slides
Reddit/Quora Software System Design by
Reddit/Quora Software System DesignReddit/Quora Software System Design
Reddit/Quora Software System DesignElia Ahadi
989 views8 slides
MariaDB MaxScale: an Intelligent Database Proxy by
MariaDB MaxScale: an Intelligent Database ProxyMariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database ProxyMarkus Mäkelä
419 views42 slides

What's hot(20)

FIDO Workshop-Demo Breakdown.pptx by FIDO Alliance
FIDO Workshop-Demo Breakdown.pptxFIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptx
FIDO Alliance653 views
MySQL/MariaDB Proxy Software Test by I Goo Lee
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
I Goo Lee2K views
HTTP - The Other Face Of Domino by Gabriella Davis
HTTP - The Other Face Of DominoHTTP - The Other Face Of Domino
HTTP - The Other Face Of Domino
Gabriella Davis4.3K views
New awesome features in MySQL 5.7 by Zhaoyang Wang
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
Zhaoyang Wang1K views
Reddit/Quora Software System Design by Elia Ahadi
Reddit/Quora Software System DesignReddit/Quora Software System Design
Reddit/Quora Software System Design
Elia Ahadi989 views
MariaDB MaxScale: an Intelligent Database Proxy by Markus Mäkelä
MariaDB MaxScale: an Intelligent Database ProxyMariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database Proxy
Markus Mäkelä419 views
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU! by Serdar Basegmez
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Serdar Basegmez2.6K views
Managing iOS with Microsoft Intune by Simon May
Managing iOS with Microsoft IntuneManaging iOS with Microsoft Intune
Managing iOS with Microsoft Intune
Simon May1.4K views
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication by Kenny Gryp
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp18.4K views
Load Testing - How to Stress Your Odoo with Locust by Odoo
Load Testing - How to Stress Your Odoo with LocustLoad Testing - How to Stress Your Odoo with Locust
Load Testing - How to Stress Your Odoo with Locust
Odoo3.1K views
Linux Instrumentation by DarkStarSword
Linux InstrumentationLinux Instrumentation
Linux Instrumentation
DarkStarSword9.7K views
High performance and high availability proxies for MySQL by Mydbops
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQL
Mydbops1.7K views
MySQL Data Encryption at Rest by Mydbops
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at Rest
Mydbops426 views
Taking conditional access to the next level by Ronny de Jong
Taking conditional access to the next levelTaking conditional access to the next level
Taking conditional access to the next level
Ronny de Jong410 views
ProxySQL High Avalability and Configuration Management Overview by René Cannaò
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
René Cannaò372 views
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded by Christoph Adler
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-ReloadedRNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
RNUG - HCL Notes 11.0.1 FP2 — Performance Boost Re-Reloaded
Christoph Adler377 views
Build enterprise wireless with CAPsMAN by GLC Networks
Build enterprise wireless with CAPsMANBuild enterprise wireless with CAPsMAN
Build enterprise wireless with CAPsMAN
GLC Networks621 views

Similar to Mobile Synchronization Patterns for Large Volumes of Data

Achieve Your State Missions with Better Data by
Achieve Your State Missions with Better DataAchieve Your State Missions with Better Data
Achieve Your State Missions with Better DataSafe Software
484 views49 slides
Mobile cloud sync by
Mobile   cloud syncMobile   cloud sync
Mobile cloud syncPrithiviraj Damodaran
391 views15 slides
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele... by
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...Fatima Qayyum
1K views25 slides
UNIT I Streaming Data & Architectures.pptx by
UNIT I Streaming Data & Architectures.pptxUNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptxRahul Borate
2 views33 slides
Enhance mobile app testing with performance-centric strategies: SauceCon 2022 by
Enhance mobile app testing with performance-centric strategies: SauceCon 2022Enhance mobile app testing with performance-centric strategies: SauceCon 2022
Enhance mobile app testing with performance-centric strategies: SauceCon 2022NITHIN S.S
120 views50 slides
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (... by
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...NITHIN S.S
206 views43 slides

Similar to Mobile Synchronization Patterns for Large Volumes of Data(20)

Achieve Your State Missions with Better Data by Safe Software
Achieve Your State Missions with Better DataAchieve Your State Missions with Better Data
Achieve Your State Missions with Better Data
Safe Software484 views
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele... by Fatima Qayyum
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
Fatima Qayyum1K views
UNIT I Streaming Data & Architectures.pptx by Rahul Borate
UNIT I Streaming Data & Architectures.pptxUNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptx
Rahul Borate2 views
Enhance mobile app testing with performance-centric strategies: SauceCon 2022 by NITHIN S.S
Enhance mobile app testing with performance-centric strategies: SauceCon 2022Enhance mobile app testing with performance-centric strategies: SauceCon 2022
Enhance mobile app testing with performance-centric strategies: SauceCon 2022
NITHIN S.S120 views
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (... by NITHIN S.S
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
NITHIN S.S206 views
"Going Offline", one of the hottest mobile app trends by Derek Baron
"Going Offline", one of the hottest mobile app trends"Going Offline", one of the hottest mobile app trends
"Going Offline", one of the hottest mobile app trends
Derek Baron556 views
Real Time Business Platform by Ivan Novick from Pivotal by VMware Tanzu Korea
Real Time Business Platform by Ivan Novick from PivotalReal Time Business Platform by Ivan Novick from Pivotal
Real Time Business Platform by Ivan Novick from Pivotal
VMware Tanzu Korea411 views
redpill Mobile Case Study (Salvation Army) by Peter Presnell
redpill Mobile Case Study (Salvation Army)redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)
Peter Presnell4.5K views
Automating Everything with FME by Safe Software
Automating Everything with FMEAutomating Everything with FME
Automating Everything with FME
Safe Software961 views
Dimensions computation meetup by Timothy Farkas
Dimensions computation meetupDimensions computation meetup
Dimensions computation meetup
Timothy Farkas906 views
Patterns for Mobile and IoT backends with serverless paradigms by Vidyasagar Machupalli
Patterns for Mobile and IoT backends with serverless paradigmsPatterns for Mobile and IoT backends with serverless paradigms
Patterns for Mobile and IoT backends with serverless paradigms
Web services have made the development of mobile Web applications much easier... by Respa Peter
Web services have made the development of mobile Web applications much easier...Web services have made the development of mobile Web applications much easier...
Web services have made the development of mobile Web applications much easier...
Respa Peter486 views
Big Data and User Segmentation in Mobile Context by InMobi Technology
Big Data and User Segmentation in Mobile ContextBig Data and User Segmentation in Mobile Context
Big Data and User Segmentation in Mobile Context
InMobi Technology1.5K views
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H... by Data Con LA
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA291 views
8 Ways Utility Networks Can Meet Data Demands by Safe Software
8 Ways Utility Networks Can Meet Data Demands8 Ways Utility Networks Can Meet Data Demands
8 Ways Utility Networks Can Meet Data Demands
Safe Software779 views
Data in Motion - tech-intro-for-paris-hackathon by Cisco DevNet
Data in Motion - tech-intro-for-paris-hackathonData in Motion - tech-intro-for-paris-hackathon
Data in Motion - tech-intro-for-paris-hackathon
Cisco DevNet807 views

More from OutSystems

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media by
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaOutSystems
5.5K views41 slides
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology by
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyOutSystems
683 views11 slides
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age... by
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
892 views21 slides
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out by
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutOutSystems
988 views23 slides
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor... by
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
642 views25 slides
Fast and Furious: Modernizing Clinical Application by
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationOutSystems
710 views25 slides

More from OutSystems(20)

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media by OutSystems
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
OutSystems5.5K views
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology by OutSystems
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
OutSystems683 views
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age... by 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...
OutSystems892 views
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out by OutSystems
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
OutSystems988 views
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor... by 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...
OutSystems642 views
Fast and Furious: Modernizing Clinical Application by OutSystems
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical Application
OutSystems710 views
What Is Light BPT and How Can You Use it for Parallel Processing? by OutSystems
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?
OutSystems1.4K views
Enrich Visually Google Map Information With Layers by OutSystems
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With Layers
OutSystems354 views
Using Processes and Timers for Long-Running Asynchronous Tasks by OutSystems
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
OutSystems372 views
Unattended OutSystems Installation by OutSystems
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
OutSystems596 views
The 4-Layer Architecture in Practice by OutSystems
The 4-Layer Architecture in PracticeThe 4-Layer Architecture in Practice
The 4-Layer Architecture in Practice
OutSystems2.7K views
Speed up Development by Turning Web Blocks Into First-Class Citizens by OutSystems
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
OutSystems302 views
Service Actions by OutSystems
Service ActionsService Actions
Service Actions
OutSystems2K views
Responsive Ui with Realtime Database by OutSystems
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
OutSystems261 views
Reactive Web Best Practices by OutSystems
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
OutSystems2.3K views
RADS - Rapid Application Design Sprint by OutSystems
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design Sprint
OutSystems286 views
Pragmatic Innovation by OutSystems
Pragmatic InnovationPragmatic Innovation
Pragmatic Innovation
OutSystems255 views
Troubleshooting Dashboard Performance by OutSystems
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard Performance
OutSystems130 views
OutSystems Tips and Tricks by OutSystems
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
OutSystems1.7K views
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W... by 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...
OutSystems353 views

Recently uploaded

tecnologia18.docx by
tecnologia18.docxtecnologia18.docx
tecnologia18.docxnosi6702
5 views5 slides
Copilot Prompting Toolkit_All Resources.pdf by
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdfRiccardo Zamana
11 views4 slides
Dapr Unleashed: Accelerating Microservice Development by
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice DevelopmentMiroslav Janeski
12 views29 slides
ShortStory_qlora.pptx by
ShortStory_qlora.pptxShortStory_qlora.pptx
ShortStory_qlora.pptxpranathikrishna22
5 views10 slides
Programming Field by
Programming FieldProgramming Field
Programming Fieldthehardtechnology
5 views9 slides
HarshithAkkapelli_Presentation.pdf by
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
12 views16 slides

Recently uploaded(20)

tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana11 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski12 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik8 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino5 views
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 views

Mobile Synchronization Patterns for Large Volumes of Data

  • 2. || Mobile Synchronization Patterns for Large Volumes of Data João Pereira Developer | Do iT Lean @ in joao.pereira@doilean.com /joão-pedro-martins-pereira-8a115b120
  • 3. || Mobile Synchronization Patterns for Large Volumes of Data Agenda
  • 4. | Mobile Synchronization Patterns for Large Volumes of Data ● The Mobile Challenge ● Let’s Recap OutSystems Best Practices ● When We Can’t Follow Best Practices . . . ● Solving the Challenge! ● Patterns in Action
  • 5. || Mobile Synchronization Patterns for Large Volumes of Data The Mobile Challenge
  • 6. | Mobile Synchronization Patterns for Large Volumes of Data ● Mobile Devices are more powerful than ever ● Mobile apps are faster and more intuitive than ever ● Users expect your app to perform like all other apps they use ● How can we do it with OutSystems?
  • 7. || Mobile Synchronization Patterns for Large Volumes of Data Let’s Recap OutSystems Best Practices
  • 8. | Mobile Synchronization Patterns for Large Volumes of Data 1. Lightweight Local Database ● Design the local storage data model using only the attributes that you need ● Transform the local data model to avoid complex queries like having multiple JOINS ● Identify the best data synchronization patterns for your use case and define exactly when to run them
  • 9. | Mobile Synchronization Patterns for Large Volumes of Data 1.1. Lightweight Local Database Example Server DB Local DB
  • 10. | Mobile Synchronization Patterns for Large Volumes of Data 2. Control the Amount of Synchronized Data ● We can control the data fetched from the server using: ■ Sync Unit ■ Local Sync Properties ■ Only get the latest data from the server ■ Only get the data that we really need
  • 11. | Mobile Synchronization Patterns for Large Volumes of Data 3. SyncUnit - Defining Synchronization Moments
  • 12. | Mobile Synchronization Patterns for Large Volumes of Data Makes a sync when the add button is Clicked 4. Use the TriggerOfflineDataSync Synchronize Data in the Background Without Freezing the UI
  • 13. | Mobile Synchronization Patterns for Large Volumes of Data 5. Avoid Multiple Server Requests On Client Actions Consolidate Server Requests into one Action Client Server
  • 14. | Mobile Synchronization Patterns for Large Volumes of Data ● Evaluate network requirements use cases ■ Define Local Storage strategy ■ Optimize data sync moments ● Evaluate network status in runtime ■ Adapt behavior accordingly ■ Let the user know what’s happening 6. Control the Network Status
  • 15. | Mobile Synchronization Patterns for Large Volumes of Data ● Corporate vs Public App ● Multiple types of devices ● Different operating systems (Android, iOS) 7. Fined Tune Data Transfers
  • 16. || Mobile Synchronization Patterns for Large Volumes of Data When We Can’t Follow Best Practices . . .
  • 17. | Mobile Synchronization Patterns for Large Volumes of Data 1. Mobile App = Web Version ● Client Demands: ■ Must have same functionality in web and mobile ■ The Mobile App is not going to be built based on mobile specific use cases but on the web application ● Developer Challenge ■ Must adapt the best practices to support this situation
  • 18. | Mobile Synchronization Patterns for Large Volumes of Data
  • 19. | Mobile Synchronization Patterns for Large Volumes of Data ● Cannot Create a Lightweight Device Database ■ Requiring JOIN’s will influence performance of the app ■ Must find ways to overcome this limitation in terms of Sync Moments ■ Analyze the use-cases the application needs ■ Minimize sync of tables that have a high volume of data ■ Minimize using data that have multiple joins on Mobile App Screens 2. All Data Must Be on the Mobile App
  • 20. || Mobile Synchronization Patterns for Large Volumes of Data Solving the Challenge!
  • 21. | Mobile Synchronization Patterns for Large Volumes of Data Controlling Time & Matter
  • 22. | Mobile Synchronization Patterns for Large Volumes of Data ● Case A - Infrequent Change ■ Treat like static data ■ Synchronize all in the first use of the application ■ Sync only when the data changes ■ Inside of the Mobile App only sync the tables & data that is really needed 1. Understanding Your Data
  • 23. | Mobile Synchronization Patterns for Large Volumes of Data ● Case B - Frequent Change ■ Like in the previous case - sync all data in first use ■ On Local to Server, only sync the modified data ■ Syncing Modified Data - Depending on the use- case, choose one of these scenarios ■ Last Write Wins ■ Server Always Win ■ Conflict Mechanism ■ Discard mechanism to prevent inconsistent data if sync processes went wrong 1. Understanding Your Data
  • 24. | Mobile Synchronization Patterns for Large Volumes of Data ● SyncUnit ■ Create a static entity with the tables we need to sync ● Create a Sync Unit History ■ Keep track of tables that need sync ■ Last date the data was changed 2. Build Your Sync Mechanism
  • 25. || Mobile Synchronization Patterns for Large Volumes of Data Patterns in Action
  • 26. | Mobile Synchronization Patterns for Large Volumes of Data ● Use case – Need to have 3000 records available at the start of the application: ■ First Use Sync Strategy – Sync all the data - must guaranty the network is 3G or superior ■ When the tables get changed just synchronize the ones that changed ■ Sync only the data that is needed to execute the functionality that is needed on the Mobile App Real World Example
  • 27. | Mobile Synchronization Patterns for Large Volumes of Data ● Create the SyncUnitHistory Record ■ Will be created on the CRUD – Create or Update Actions of the tables we want to sync ■ This table will have SyncUnitId and the Last Updated Date ■ Used to know the date of the last changed record of a table that we will need to sync How to know when and what needs to be Synced?
  • 28. | Mobile Synchronization Patterns for Large Volumes of Data ● Get SyncUnits To Sync: ■ Action to check which SyncUnits need to be refreshed on your mobile app ■ Receives the Device Date and returns the list of ids of the tables that need to be sync ■ The action is used in the mobile synchronization action How to know what tables we need to Sync ?
  • 29. | Mobile Synchronization Patterns for Large Volumes of Data ● Create a Control of Sync in Local Storage: ■ Sync controller in the local storage ■ This will kept track of the tables that already have been synced and when it was done Client-Side LastSync Controller
  • 30. | Mobile Synchronization Patterns for Large Volumes of Data Example - MaterialType table Table with large volume of data
  • 31. | Mobile Synchronization Patterns for Large Volumes of Data ● Sync of Material Type : ■ Get the Material-Types that are present on the server ■ In the first time will get all ■ Next time is filter by date from, date to and only the active ones ■ LocaleId is passed because app is multilingual ■ As output we get the Server Material Types and the total records 1. Create Sync Material-Type action
  • 32. | Mobile Synchronization Patterns for Large Volumes of Data ● Sync of Material Type client side : ■ Create our Material-Type Local Storage; ■ Last Sync table to get the interval of time the date will be get ■ Updates the controller for the sync unit Material-Type 2. Action on client side to fill Material-Type local table
  • 33. | Mobile Synchronization Patterns for Large Volumes of Data ● OfflineDataSync Action : ■ Sync the Local Data into the Server ■ If no errors occur, we start the sync of the large volume of data tables ■ Sync the tables with less volume of data 3. Mobile synchronization process
  • 34. | Mobile Synchronization Patterns for Large Volumes of Data ● Sync_LC_Check Action : ■ Check’s our connection because we need to have network ■ Get SyncUnits to update list to check which tables need to be sync ■ Update the sync controller Last Sync and run the action Sync_LC_Update 4. Trigger and know which tables we going to Sync
  • 35. | Mobile Synchronization Patterns for Large Volumes of Data ● Sync_LC_Update Action : ■ This action will receive as input the SyncUnit and only update the respective table 5. Action that Syncs the large volume of data tables
  • 36. | Mobile Synchronization Patterns for Large Volumes of Data Dealing with Conflict
  • 37. | Mobile Synchronization Patterns for Large Volumes of Data ● Use Case: ■ When multiple users can change the same data and the mobile app can be used offline ■ You need a mechanism to determine which data is conflicting ■ You need a screen so the user can choose the correct data How to Create a Conflict Screen on Your Mobile App
  • 38. | Mobile Synchronization Patterns for Large Volumes of Data ● Solution: ■ Create a Static Table with the Entities name that we want to make conflict detection and resolution ■ Then use that static entity and create one local entity that will keep the table name and a flag if exist conflict ■ When we try to sync or update the local record into the server we need to check if a conflict exists ■ If a conflict exists create an entry on the table of conflicts and add a record to the list How to Create a Conflict Screen on Your Mobile App
  • 39. | Mobile Synchronization Patterns for Large Volumes of Data 1. Creating the list of Conflicts
  • 40. | Mobile Synchronization Patterns for Large Volumes of Data ● Conflict Resolution: ■ After click on the list the Conflict Element’s will appear ■ Local & Server record are serialize & deserialize into a JSON ■ Screen less heavy and with better performance ■ Can be optimized to choose attribute by attribute instead of record 2. Conflict Screen on Mobile App to Compare Data
  • 41. | Mobile Synchronization Patterns for Large Volumes of Data
  • 42. || Mobile Synchronization Patterns for Large Volumes of Data Q & A
  • 43. | Thank You! @ injoao.pereira@doilean.com / joão-pedro-martins- pereira-8a115b120

Editor's Notes

  1. My name is João Pereira Last year I was in your place So im so glad to be making this presentation
  2. The Mobile Challenge Let’s Recap OutSystems Best Practices When We Can’t Follow Best Practices . . . Solving the Challenge! Patterns in Action
  3. Mobile Devices are more powerful than ever Mobile apps are faster and more intuitive than ever Users expect your app to perform like all other apps they use How can we do it with OutSystems
  4. Design the local storage data model using only the attributes that you need, instead of all attributes of the corresponding server entity. Consider denormalizing the local data model to avoid complex queries like having multiple JOINS. Identify the best data synchronization patterns for your use case and define exactly when to run them.
  5. To explain better the OutSystems Best Practice I created a small DB and a concept of an App that got the objective of having a platform where clients find car dealers which have cars in stock; The car dealers can add cars to his stock The clients can search by car dealer or model they want to buy Process of denormalization Simplify the connection between tables and minimize the amount of information
  6. We can control the data fetched from the server using; Sync Unit –several flows of synchornization Local Sync Properties – Create a local entity to keep track of the last synchronization moment Only get the latest data from the server – Compare the LastSycnOn from that sync unit with the CreatedOn, UpdatedOn and DeletedOn attributes from the server DB to know which records to fetch
  7. This image represents the third best practice using the sync unit to define the moments we want to sync our DB between local and server As you can see we define 3 moments 1. Get New Stock – On the Menu of the application the user clicks on a buttons or slides and refresh the list of car with the more recent 2. Remove sold cars , when a Car dealer changes the status of the car to available to sold 3. When the Owner of car dealers add new Change the image to more general information ;
  8. TriggerOfflineDataSync – explanation Devemos antecipar qual a informação que o utilizador precisa antes da mesma ser utilizada para assim obter uma fluidez dentro da aplicação
  9. As you know each server action called inside cliente actions executes a request to the server so if we call several server actions inside cliente action that will leave to open and close multiple requests in the same action that is going to be less performance that use like the exemple above one server action inside a cliente actions. Is visible that in that server action know it’s no problem use more than one This need to be applied to normal client actions of the app as well to our synchronization actions that will get and sync all the information we need
  10. Evaluate network requirements and use cases - If the application needs to be online or offline To evaluate the data sync moments Adapt behavior according to network strength, including offline Check how long we got to do the sync actions The moments we must sync all the information of the app. ############################################################# Evaluate network requirements use cases Define Local Storage strategy Optimize data sync moments Evaluate network status in runtime Adapt behavior accordingly Let the user know what’s happening
  11. Find the Optimal Value of Records to BULK Create According to the Different Processing Capabilities of Each Device Talk about 2 diferente scenarios – 1 . Corporate Use , 2. Target is the world B – B B – E
  12. After I recap you some of the OutSystems Best Pratices I will show you that they don’t work for every situation and that sometimes we cannot use them
  13. Must have same functionalities in web and mobile; The Data model cannot suffer the changes we want to have a lightweight database on the mobile app; The Mobile App is not going to be built base on the specific use cases but on the Web App We need to adapt the best practices the best we can on this situation When you ever Put the boss with the tie photo
  14. Have JOIN’s that will influence the performance of the application; Must think ways to overcome this limitation in terms of Sync Moments and how to do it; Analyze with are the use-cases the application needs Try to minimize sync of tables that got a high volume of data . Find strategies to sync the information the minimum times possible In the Mobile App Screens minimize the data that have multiple joins . So if we need the data that have multiple joins try to use only that information on the mobile screen
  15. How did you solve it ? In this part of the presentation we are going to show how to overcome the difficulties when we can’t use the best practices and have a huge database to manage in the local storage and need to sync a huge flow of data between Web and Mobile
  16. In the case of not changes frequently; Take care of this tables like lookup; Just need be synchronize all in the first use of the application; When this tables get changes just synchronize the ones that real change and not all Sync only the data that is neded to execute all the functionalities that are really need on the mobile AppCase A - Infrequent Change Treat like static data Synchronize all in the first use of the application Sync only when the data changes Inside of the Mobile App only sync the tables & data that is really needed
  17. Like in the previous case in the first use we need to sync all the tables; When modified the data only sync the modified back to the server; Choose well what information we want to override choosing one of this scenarios (Last Write Wins, Server always Win or Conflict Mechanism Detection) If we don’t have a good network, we must have a mechanism that discard a sync that was not fully completed in order to not have inconsistent data in our application
  18. Create a Sync Unit History Keep track of tables that need sync Last date the data was changed SyncUnit Create a static entity with the tables we need to sync
  19. Patterns in Action – I’m going to present you the real cases scenarios we use some strategies like the sync unit as table selector and how we do the sync of a big volume database
  20. In the case of not changes frequently; Take care of this tables like lookup; Just need be synchronize all in the first use of the application; When this tables get changes just synchronize the ones that real change and not all Sync only the data that is needed to execute all the functionalities that are really need on the mobile App The data doesn’t change a lot
  21. Inside the Core of the tables we want to sync was created: Static table called Sync Unit that contain all the tables we want to sync to the mobile app (SyncUnit.Label = MaterialType) A new table called SyncUnitHistory that will have the static Id from the previous table and the Last Updated Date The records of the SycnUnitHistory are going to be created on the actions of Created or Updated a entity we want to sync to mobile
  22. Also in the Core module was created a action to see what are the sync units that needs to sync data This action receives the Device Date and returns the list of id’s of the tables that needs to be sync Is going to be used on the mobile synchronization action
  23. As we done in the previous step, we create a control sync server table We need to create a LastSync table at will got the SyncUnit Id and the date from and date to of the Last Sync made on the device
  24. Client actions and server actions created to do the sync: Was created a new module in the Mobile App to manage the Local Storage and Sync actions to use in the APP All Local Tables are in this module Going to present the example to one table Material Type that got a dependency that is Material Type with a List of values, that is called Material Type LOV Dependency
  25. This action will get the Material Types that are present on the server In the first time will get all but on the next time is filter by date from, date to and only the active ones Because the application is multilingual, we need to pass the LocaleId we want to get the data As output we got the Server Material Types and the total records just to control how many data was sync at that time
  26. This an action will create our Material Type that is going to be at the Local Storage Used the Last Sync table to get the interval of time we are going to get the data In the end updates the controller for the sync unit Material Type
  27. This action will first check our connection because we need to make sure we got a good connection to sync large volumes of data and we going to use server-side actions The next step is using our Get SyncUnits to update list to check which tables need to be sync After get the list we update the sync controller Last Sync and run the action Sync_LC_Update
  28. This action will receive as input the SyncUnit and only update that respective table Then will run the Sync of Material Type on this case that we talk on the previous slide
  29. When multiple users can change the same data and the mobile app can be used offline How to create the data of conflict ? Where we choose the correct data ?
  30. Create a Static Table with the Entities name that we want to make conflict detection and resolution Then use that static entity and create one local that will keep the table name and a flag if exist conflict When we try to sync the local record into the server we need to check if a conflict exists If a conflict exists create an entry on the table of conflicts and add a record to a list
  31. Situation when we can check the conflict: When we try to save the record if we got internet connection, we can compare with the information that are present in the server at the moment When we try to sync the local data and put them into the server will check if that records was change In any of this cases is created a list with the table name and the number of conflicts that exist at that moment
  32. When we click in element of the previous list will appear a detail screen so the user can choose the server data or local data This data will get the Local record and the Server record and serialize & deserialize then into a JSON That process will make the screen less heavy and with better performance Can be optimized to choose attribute by attribute instead of record ##################################################################################################### I hope you enjoyed this presentation and next time you face this kind of challenge you remember what we talk about today !
  33. I hope you enjoyed this presentation and next time you face this kind of challenge you remember what we talk about today !