SlideShare a Scribd company logo
Optimizing Offline Data
Synchronization for Mobile Apps
Teodoro Alonso (Ted), salesforce.com, Technical Solutions Architect
@tgalonso
Safe harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of
our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these
forward-looking statements.
Teodoro Alonso (Ted)
Technical Solutions Architect
@tgalonso
Introduction
•By a show of hands, for those of you have implemented a mobile
application that uses Salesforce data offline?
•How many of you think that you accomplished your initial goals for
the mobile app?
•What prevented you from achieving the goals that you set for your
mobile application?
Goal
• Present a set of Good Practices and Design Patterns that
help Optimize Mobile Data Synchronization.
• Describe common pitfalls to avoid when dealing with sync
Why is Mobile Data Synchronization so difficult to
implement?
•

Too much Data to synchronize in a reasonable amount of time.
•

•

Users dread using the App

Unreliable or slow connectivity can cause:
•
•

•

Unreliable synchronizations
Synchronization that “never ends”

Complex Salesforce Data Model results in:
•

Slow or impossible queries.

•

Failed queries due to governor limits
McGraw-Hill Education Artemis Video

Artemis Movie
McGraw-Hill Education Artemis Application Goals
•

Eliminate the need to carry around a laptop on campus to access multiple
apps via browser

•

Make the sales rep more efficient while on campus and also reduce postcampus work

•

Improve data quality and completeness in Salesforce, resulting in
improved analytics

•

Implement common processes to bring new reps up to speed faster
McGraw-Hill Education Artemis Application
•

Business Use Case 1: Provide Sales Reps with a Mobile Application to
help them sell products to Campus Professors by enabling them to identify
the most important opportunities tied to different professors and allow them
to plan these meetings using a daily plan while online or offline

•

Business Use Case 2: Provide Sales Reps with a way to update the
opportunities, keep notes, create sample orders and update contact data
online and offline.

•

Business Use Case 3: Provide Sales Reps with a way to update to show
the targeted product based on the courses that the Professor teaches
opportunities online and offline.
Architecture of the Artemis
McGraw-Hill Education App
Artemis User

UIWebView
MHU, Addesses

Commands

Frontdoor.jsp

MHHE Users
SFDC URL
SessionID

Commands
SessionID

VF Pages

SessionID
OAuth 2.0
MHHE
Objects

SFDC CRM Library
SFDC CRM Library

Accounts, Contacts,
Opportunitites,
Products, Addresses,
Samples, etc.

SFDC1 Platform
Identity

Connected Apps

Access
Token

RESTframework
Sync Engine

Sync

Access/Refresh
Tokens
SFDC Rest API
SFDC1 Platform
RestKit

MHHE Objects

MHHE Objects

Artemis App
Design Pattern 1: “They don’t need all the data”
The users don’t need “all the data” and you should identify the precious little
data items that are truly required.
Characterize the user’s need for Salesforce data
•

Do ride alongs to identify the data that the user’s need in a sales call
•

•

Identify the tasks that the users do and define what tasks have the need for offline data.

Talk to their managers about what are the goals of the users and what data needs to be collected offline.
•

Orders, Proposals, Contact, Account, Opportunities account creation/update

•

For the updated records, do you need more than the owned records?
Design Pattern 1: Persona Example
Design Pattern 1: “They don’t need all the data” -cont
Synchronization Worksheet

Object
Synchronization
Data Filter

Account
To App
MHHE Mobile Sync
Flag = True

Fields

Dependency

Id
Name
Phone
Shipping Address

Address, Contact,
Case

Do a test “Data Pull” using the Data Loader to estimate the data payload size.
.
Design Pattern 2: Reduce the number of objects by
flattening the data model
Move one or two fields from a parent to a child in a lookup relationship using
formula fields to avoid having to synchronize the parent object.
Reduces the number of different objects and fields to transfer.
Reduces reference resolution post sync
Account
Id
Account Owner : Lookup (User)
...
AccountOwner Name: Formula (Owner.FirstName + ' ' +
Owner.LastName)
...

User
Id
...
FirstName
LastName
...
Design Pattern 3: Let Salesforce help Sync Objects
• Add the Mobile_Sync_Flag to the objects to be synchronized. Can be a
Formula field or Set by batch Apex processes (Preferred).
•

Sync those records WHERE Mobile_Sync_Flag = true

•

Much more simple query

• This technique can also be used to do Pseudo-OR id queries:
•

For example, if we can to pull all the Addresses for all the Contacts OR Accounts already
downloaded to the Mobile App. We can specify the following WHERE clause:
((MHHE_Contact_Flag__c = true AND Contact__r.MHHE_Mobile_Sync_Flag__c = true) OR
(MHHE_Account_Flag__c = true AND Account__r.MHHE_Mobile_Sync_Flag__c = true))
Design Anti-Pattern 1: The User Knows How to
Resolve Conflicts
• Pop a modal dialog and ask the user to resolve Synchronization Conflicts.
• Stops the sync completion
• Potentially error prone user interface.
• Does the user have the knowledge to make the correct choices?
• This Anti-Pattern results in a complex user interface with the potential for
corrupt data.
Design Pattern 4: Take the Last Version Unless
Salesforce Says Otherwise
• Identify all the objects that will have bidirectional synchronization
• Determines the potential conflict objects
• Will a Last Modified Record Strategy work for all cases?
•

If so, implement this strategy.

•

Assumes that the field value verification can be done locally (Mobile or Salesforce)

• Do you need Salesforce to verify the fields in the mobile originated record?
•

Implement a “Before Insert” “Before Update” trigger in Salesforce that identifies the
incoming Mobile records and verifies and cleanses the fields as necessary

•

Have the Mobile re-Read the Upserted records to insure that it has the cleansed fields
Conclusion
Don’t just push data to a mobile just because they might need it someday.
Carefully select the objects and records that the user absolutely requires
Determine the sync direction for the objects and decide on what to do for
bidirectional sync conflicts.
Simplify the data you send to a mobile to speed up processing post download
Only pull the fields that you need from an object or their parent object
Don’t allocate all the synchronization work on the client
Leverage Salesforce formula fields and batch processes to preselect the
data to be synchronized.
Ted Alonso

Steve Deren

Technical Solutions Architect,
@tgalonso

Senior Technical Consultant
Dreamforce 13 Optimizing Data Sync for Mobile Apps

More Related Content

What's hot

Office Share Point Server 2007 Product Guide
Office Share Point Server 2007 Product GuideOffice Share Point Server 2007 Product Guide
Office Share Point Server 2007 Product Guide
UGAIA
 

What's hot (20)

IBM Forms Experience Builder - Web Form Apps for Marketers
IBM Forms Experience Builder - Web Form Apps for MarketersIBM Forms Experience Builder - Web Form Apps for Marketers
IBM Forms Experience Builder - Web Form Apps for Marketers
 
Office Share Point Server 2007 Product Guide
Office Share Point Server 2007 Product GuideOffice Share Point Server 2007 Product Guide
Office Share Point Server 2007 Product Guide
 
KanhaSoft Web & Mobile Portfolio
KanhaSoft Web & Mobile PortfolioKanhaSoft Web & Mobile Portfolio
KanhaSoft Web & Mobile Portfolio
 
Share Point Ax
Share Point AxShare Point Ax
Share Point Ax
 
Expert Hour: Salesforce integration tools - why, what & how?
Expert Hour:  Salesforce integration tools - why, what & how?Expert Hour:  Salesforce integration tools - why, what & how?
Expert Hour: Salesforce integration tools - why, what & how?
 
Horton, kathy SFDC Consultant resume
Horton, kathy SFDC Consultant resumeHorton, kathy SFDC Consultant resume
Horton, kathy SFDC Consultant resume
 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App Cloud
 
Ad402 create self-service apps in minutes with ibm forms experience builder
Ad402   create self-service apps in minutes with ibm forms experience builderAd402   create self-service apps in minutes with ibm forms experience builder
Ad402 create self-service apps in minutes with ibm forms experience builder
 
IBM Forms Experience Builder v8.6
IBM Forms Experience Builder v8.6IBM Forms Experience Builder v8.6
IBM Forms Experience Builder v8.6
 
Salesforce Platform Keynote - Dreamforce 2012 - 9/18
Salesforce Platform Keynote - Dreamforce 2012 - 9/18Salesforce Platform Keynote - Dreamforce 2012 - 9/18
Salesforce Platform Keynote - Dreamforce 2012 - 9/18
 
Reshape your digital transformation strategy using low code platforms
Reshape your digital transformation strategy using low code platformsReshape your digital transformation strategy using low code platforms
Reshape your digital transformation strategy using low code platforms
 
Salesforce didyouknow
Salesforce didyouknowSalesforce didyouknow
Salesforce didyouknow
 
Business model innovation in the cloud v1
Business model innovation in the cloud v1Business model innovation in the cloud v1
Business model innovation in the cloud v1
 
AA4_finalReport
AA4_finalReportAA4_finalReport
AA4_finalReport
 
Alert framework2021
Alert framework2021Alert framework2021
Alert framework2021
 
Salesforce overview
Salesforce overviewSalesforce overview
Salesforce overview
 
How to Solve the Biggest Problems with Salesforce Training
How to Solve the Biggest Problems with Salesforce TrainingHow to Solve the Biggest Problems with Salesforce Training
How to Solve the Biggest Problems with Salesforce Training
 
8 rules of consolidation
8 rules of consolidation8 rules of consolidation
8 rules of consolidation
 
Appirio Lead Generation presentation on Salesforce
Appirio Lead Generation presentation on SalesforceAppirio Lead Generation presentation on Salesforce
Appirio Lead Generation presentation on Salesforce
 
Recruitment Application full SRS developed in Salesforce.com
Recruitment Application full SRS developed in Salesforce.comRecruitment Application full SRS developed in Salesforce.com
Recruitment Application full SRS developed in Salesforce.com
 

Viewers also liked

Gasteizko irteera 2A - MELI
Gasteizko irteera 2A - MELIGasteizko irteera 2A - MELI
Gasteizko irteera 2A - MELI
arbelar
 
Lyserødlørdag 2012
Lyserødlørdag 2012Lyserødlørdag 2012
Lyserødlørdag 2012
Merethe Kepp
 
PROJECT FINAL PRESENTATION
PROJECT FINAL PRESENTATIONPROJECT FINAL PRESENTATION
PROJECT FINAL PRESENTATION
Antoine Fournier
 
Gasteizko irteera 2B MARRUBI
Gasteizko irteera 2B MARRUBIGasteizko irteera 2B MARRUBI
Gasteizko irteera 2B MARRUBI
arbelar
 
未來的工作在哪裡
未來的工作在哪裡未來的工作在哪裡
未來的工作在哪裡
rita710
 
「開放式領導」第一章 掌控還管用嗎?
「開放式領導」第一章 掌控還管用嗎?「開放式領導」第一章 掌控還管用嗎?
「開放式領導」第一章 掌控還管用嗎?
Douny Yang
 

Viewers also liked (20)

Contemporary issues 04 09-2014
Contemporary issues 04 09-2014Contemporary issues 04 09-2014
Contemporary issues 04 09-2014
 
Gasteizko irteera 2A - MELI
Gasteizko irteera 2A - MELIGasteizko irteera 2A - MELI
Gasteizko irteera 2A - MELI
 
Flyer
Flyer Flyer
Flyer
 
Lyserødlørdag 2012
Lyserødlørdag 2012Lyserødlørdag 2012
Lyserødlørdag 2012
 
Maude’s life in pictures final-as PDF
Maude’s life in pictures final-as PDFMaude’s life in pictures final-as PDF
Maude’s life in pictures final-as PDF
 
Oracle 11G- PLSQL
Oracle 11G- PLSQLOracle 11G- PLSQL
Oracle 11G- PLSQL
 
PROJECT FINAL PRESENTATION
PROJECT FINAL PRESENTATIONPROJECT FINAL PRESENTATION
PROJECT FINAL PRESENTATION
 
Question Focus Recognition in Question Answering Systems
Question Focus Recognition in Question  Answering Systems Question Focus Recognition in Question  Answering Systems
Question Focus Recognition in Question Answering Systems
 
Gasteizko irteera 2B MARRUBI
Gasteizko irteera 2B MARRUBIGasteizko irteera 2B MARRUBI
Gasteizko irteera 2B MARRUBI
 
Коммуникации органов власти Алтайского края с населением (монография)
Коммуникации органов власти Алтайского края с населением (монография)Коммуникации органов власти Алтайского края с населением (монография)
Коммуникации органов власти Алтайского края с населением (монография)
 
Kemahiran Komunikasi
Kemahiran KomunikasiKemahiran Komunikasi
Kemahiran Komunikasi
 
Daftarhadir&nilai statistik1314
Daftarhadir&nilai statistik1314Daftarhadir&nilai statistik1314
Daftarhadir&nilai statistik1314
 
Oracle SPARC T5 M5 - Il parere di IDC
Oracle SPARC T5 M5 - Il parere di IDCOracle SPARC T5 M5 - Il parere di IDC
Oracle SPARC T5 M5 - Il parere di IDC
 
Инструмент для кладки кирпича
Инструмент для кладки кирпичаИнструмент для кладки кирпича
Инструмент для кладки кирпича
 
未來的工作在哪裡
未來的工作在哪裡未來的工作在哪裡
未來的工作在哪裡
 
щебень
щебеньщебень
щебень
 
「開放式領導」第一章 掌控還管用嗎?
「開放式領導」第一章 掌控還管用嗎?「開放式領導」第一章 掌控還管用嗎?
「開放式領導」第一章 掌控還管用嗎?
 
Los sustantivos
Los sustantivosLos sustantivos
Los sustantivos
 
An approach for knowledge-driven product, process and resource mappings for a...
An approach for knowledge-driven product, process and resource mappings for a...An approach for knowledge-driven product, process and resource mappings for a...
An approach for knowledge-driven product, process and resource mappings for a...
 
Facebook Stats
Facebook StatsFacebook Stats
Facebook Stats
 

Similar to Dreamforce 13 Optimizing Data Sync for Mobile Apps

Salesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUGSalesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUG
Tom Gersic
 
Mobile AppExchange in the Field Great Apps at Work
Mobile AppExchange in the Field Great Apps at WorkMobile AppExchange in the Field Great Apps at Work
Mobile AppExchange in the Field Great Apps at Work
dreamforce2006
 
Turbocharging AppExchange
Turbocharging AppExchangeTurbocharging AppExchange
Turbocharging AppExchange
dreamforce2006
 

Similar to Dreamforce 13 Optimizing Data Sync for Mobile Apps (20)

Salesforce Campus Tour - Declarative
Salesforce Campus Tour - DeclarativeSalesforce Campus Tour - Declarative
Salesforce Campus Tour - Declarative
 
Communities & Dreamforce Key Takeaways
Communities & Dreamforce Key TakeawaysCommunities & Dreamforce Key Takeaways
Communities & Dreamforce Key Takeaways
 
Salesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUGSalesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUG
 
Platform session 1 Innovation on the salesforce platform - speed vs control
Platform session 1 Innovation on the salesforce platform - speed vs controlPlatform session 1 Innovation on the salesforce platform - speed vs control
Platform session 1 Innovation on the salesforce platform - speed vs control
 
Dreamforce 2013 - Heroku 5 use cases
Dreamforce 2013 - Heroku 5 use casesDreamforce 2013 - Heroku 5 use cases
Dreamforce 2013 - Heroku 5 use cases
 
Transition to the Lightning Experience: Pro Tips, Tools and a Transition Stra...
Transition to the Lightning Experience: Pro Tips, Tools and a Transition Stra...Transition to the Lightning Experience: Pro Tips, Tools and a Transition Stra...
Transition to the Lightning Experience: Pro Tips, Tools and a Transition Stra...
 
Salesforce Campus Tour - Developer Intro
Salesforce Campus Tour - Developer IntroSalesforce Campus Tour - Developer Intro
Salesforce Campus Tour - Developer Intro
 
Innovation Showcase: Top Public Sector Apps Built on Salesforce App Cloud
Innovation Showcase: Top Public Sector Apps Built on Salesforce App CloudInnovation Showcase: Top Public Sector Apps Built on Salesforce App Cloud
Innovation Showcase: Top Public Sector Apps Built on Salesforce App Cloud
 
Scaling Developer Efforts with Salesforce Marketing Cloud
Scaling Developer Efforts with Salesforce Marketing CloudScaling Developer Efforts with Salesforce Marketing Cloud
Scaling Developer Efforts with Salesforce Marketing Cloud
 
Champion Productivity with Service Cloud
Champion Productivity with Service CloudChampion Productivity with Service Cloud
Champion Productivity with Service Cloud
 
Mobile AppExchange in the Field Great Apps at Work
Mobile AppExchange in the Field Great Apps at WorkMobile AppExchange in the Field Great Apps at Work
Mobile AppExchange in the Field Great Apps at Work
 
Modev presentation
Modev presentationModev presentation
Modev presentation
 
An ISVs Guide to Building Creative, Next-Gen Apps (October 15, 2014)
An ISVs Guide to Building Creative, Next-Gen Apps (October 15, 2014)An ISVs Guide to Building Creative, Next-Gen Apps (October 15, 2014)
An ISVs Guide to Building Creative, Next-Gen Apps (October 15, 2014)
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 
AppExchange for Admins: Apps Every Admin Should Know
AppExchange for Admins: Apps Every Admin Should KnowAppExchange for Admins: Apps Every Admin Should Know
AppExchange for Admins: Apps Every Admin Should Know
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Faster In The Cloud
Faster In The CloudFaster In The Cloud
Faster In The Cloud
 
Turbocharging AppExchange
Turbocharging AppExchangeTurbocharging AppExchange
Turbocharging AppExchange
 
Developer Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformDeveloper Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 Platform
 
Process Automation Showdown Session 2
Process Automation Showdown Session 2Process Automation Showdown Session 2
Process Automation Showdown Session 2
 

Recently uploaded

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
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
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

Dreamforce 13 Optimizing Data Sync for Mobile Apps

  • 1. Optimizing Offline Data Synchronization for Mobile Apps Teodoro Alonso (Ted), salesforce.com, Technical Solutions Architect @tgalonso
  • 2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Teodoro Alonso (Ted) Technical Solutions Architect @tgalonso
  • 4. Introduction •By a show of hands, for those of you have implemented a mobile application that uses Salesforce data offline? •How many of you think that you accomplished your initial goals for the mobile app? •What prevented you from achieving the goals that you set for your mobile application?
  • 5. Goal • Present a set of Good Practices and Design Patterns that help Optimize Mobile Data Synchronization. • Describe common pitfalls to avoid when dealing with sync
  • 6. Why is Mobile Data Synchronization so difficult to implement? • Too much Data to synchronize in a reasonable amount of time. • • Users dread using the App Unreliable or slow connectivity can cause: • • • Unreliable synchronizations Synchronization that “never ends” Complex Salesforce Data Model results in: • Slow or impossible queries. • Failed queries due to governor limits
  • 7. McGraw-Hill Education Artemis Video Artemis Movie
  • 8. McGraw-Hill Education Artemis Application Goals • Eliminate the need to carry around a laptop on campus to access multiple apps via browser • Make the sales rep more efficient while on campus and also reduce postcampus work • Improve data quality and completeness in Salesforce, resulting in improved analytics • Implement common processes to bring new reps up to speed faster
  • 9. McGraw-Hill Education Artemis Application • Business Use Case 1: Provide Sales Reps with a Mobile Application to help them sell products to Campus Professors by enabling them to identify the most important opportunities tied to different professors and allow them to plan these meetings using a daily plan while online or offline • Business Use Case 2: Provide Sales Reps with a way to update the opportunities, keep notes, create sample orders and update contact data online and offline. • Business Use Case 3: Provide Sales Reps with a way to update to show the targeted product based on the courses that the Professor teaches opportunities online and offline.
  • 10. Architecture of the Artemis McGraw-Hill Education App Artemis User UIWebView MHU, Addesses Commands Frontdoor.jsp MHHE Users SFDC URL SessionID Commands SessionID VF Pages SessionID OAuth 2.0 MHHE Objects SFDC CRM Library SFDC CRM Library Accounts, Contacts, Opportunitites, Products, Addresses, Samples, etc. SFDC1 Platform Identity Connected Apps Access Token RESTframework Sync Engine Sync Access/Refresh Tokens SFDC Rest API SFDC1 Platform RestKit MHHE Objects MHHE Objects Artemis App
  • 11. Design Pattern 1: “They don’t need all the data” The users don’t need “all the data” and you should identify the precious little data items that are truly required. Characterize the user’s need for Salesforce data • Do ride alongs to identify the data that the user’s need in a sales call • • Identify the tasks that the users do and define what tasks have the need for offline data. Talk to their managers about what are the goals of the users and what data needs to be collected offline. • Orders, Proposals, Contact, Account, Opportunities account creation/update • For the updated records, do you need more than the owned records?
  • 12. Design Pattern 1: Persona Example
  • 13. Design Pattern 1: “They don’t need all the data” -cont Synchronization Worksheet Object Synchronization Data Filter Account To App MHHE Mobile Sync Flag = True Fields Dependency Id Name Phone Shipping Address Address, Contact, Case Do a test “Data Pull” using the Data Loader to estimate the data payload size. .
  • 14. Design Pattern 2: Reduce the number of objects by flattening the data model Move one or two fields from a parent to a child in a lookup relationship using formula fields to avoid having to synchronize the parent object. Reduces the number of different objects and fields to transfer. Reduces reference resolution post sync Account Id Account Owner : Lookup (User) ... AccountOwner Name: Formula (Owner.FirstName + ' ' + Owner.LastName) ... User Id ... FirstName LastName ...
  • 15. Design Pattern 3: Let Salesforce help Sync Objects • Add the Mobile_Sync_Flag to the objects to be synchronized. Can be a Formula field or Set by batch Apex processes (Preferred). • Sync those records WHERE Mobile_Sync_Flag = true • Much more simple query • This technique can also be used to do Pseudo-OR id queries: • For example, if we can to pull all the Addresses for all the Contacts OR Accounts already downloaded to the Mobile App. We can specify the following WHERE clause: ((MHHE_Contact_Flag__c = true AND Contact__r.MHHE_Mobile_Sync_Flag__c = true) OR (MHHE_Account_Flag__c = true AND Account__r.MHHE_Mobile_Sync_Flag__c = true))
  • 16. Design Anti-Pattern 1: The User Knows How to Resolve Conflicts • Pop a modal dialog and ask the user to resolve Synchronization Conflicts. • Stops the sync completion • Potentially error prone user interface. • Does the user have the knowledge to make the correct choices? • This Anti-Pattern results in a complex user interface with the potential for corrupt data.
  • 17. Design Pattern 4: Take the Last Version Unless Salesforce Says Otherwise • Identify all the objects that will have bidirectional synchronization • Determines the potential conflict objects • Will a Last Modified Record Strategy work for all cases? • If so, implement this strategy. • Assumes that the field value verification can be done locally (Mobile or Salesforce) • Do you need Salesforce to verify the fields in the mobile originated record? • Implement a “Before Insert” “Before Update” trigger in Salesforce that identifies the incoming Mobile records and verifies and cleanses the fields as necessary • Have the Mobile re-Read the Upserted records to insure that it has the cleansed fields
  • 18. Conclusion Don’t just push data to a mobile just because they might need it someday. Carefully select the objects and records that the user absolutely requires Determine the sync direction for the objects and decide on what to do for bidirectional sync conflicts. Simplify the data you send to a mobile to speed up processing post download Only pull the fields that you need from an object or their parent object Don’t allocate all the synchronization work on the client Leverage Salesforce formula fields and batch processes to preselect the data to be synchronized.
  • 19. Ted Alonso Steve Deren Technical Solutions Architect, @tgalonso Senior Technical Consultant

Editor's Notes

  1. Describe the architecture of a Mobile App with offline storage
  2. Describe each of the fields and their purpose