Developing Data Migrations and Integrations with Salesforce: Patterns and Best Practices

359 188 0
Developing Data Migrations and Integrations with Salesforce: Patterns and Best Practices

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Migrate your data to Salesforce and build lowmaintenance and highperforming data integrations to get the most out of Salesforce and make it a goto place for all your organizations customer information.When companies choose to roll out Salesforce, users expect it to be the place to find any and all Information related to a customer―the coveted Client 360° view. On the day you go live, users expect to see all their accounts, contacts, and historical data in the system. They also expect that data entered in other systems will be exposed in Salesforce automatically and in a timely manner.This book shows you how to migrate all your legacy data to Salesforce and then design integrations to your organizations missioncritical systems. As the Salesforce platform grows more powerful, it also grows in complexity. Whether you are migrating data to Salesforce, or integrating with Salesforce, it is important to understand how these complexities need to be reflected in your design. Developing Data Migrations and Integrations with Salesforce covers everything you need to know to migrate your data to Salesforce the right way, and how to design lowmaintenance, highperforming data integrations with Salesforce. This book is written by a practicing Salesforce integration architect with dozens of Salesforce projects under his belt. The patterns and practices covered in this book are the results of the lessons learned during those projects.What You’ll LearnKnow how Salesforce’s data engine is architected and whyUse the Salesforce Data APIs to load and extract dataPlan and execute your data migration to SalesforceDesign lowmaintenance, highperforming data integrations with SalesforceUnderstand common data integration patterns and the pros and cons of eachKnow realtime integration options for SalesforceBe aware of common pitfallsBuild reusable transformation code covering commonly needed Salesforce transformation patternsWho This Book Is ForThose tasked with migrating data to Salesforce or building ongoing data integrations with Salesforce, regardless of the ETL tool or middleware chosen; project sponsors or managers nervous about data tracks putting their projects at risk; aspiring Salesforce integration andor migration specialists; Salesforce developers or architects looking to expand their skills and take on new challenges

Developing Data Migrations and Integrations with Salesforce Patterns and Best Practices — David Masri Developing Data Migrations and Integrations with Salesforce Patterns and Best Practices David Masri Developing Data Migrations and Integrations with Salesforce: Patterns and Best Practices David Masri Brooklyn, NY, USA ISBN-13 (pbk): 978-1-4842-4208-7 https://doi.org/10.1007/978-1-4842-4209-4 ISBN-13 (electronic): 978-1-4842-4209-4 Library of Congress Control Number: 2018966512 Copyright © 2019 by David Masri This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Trademarked names, logos, and images may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Susan McDermott Development Editor: Laura Berendson Coordinating Editor: Rita Fernando Cover designed by eStudioCalamar Cover image designed by Freepik (www.freepik.com) Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springersbm.com, or visit www.springeronline.com Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc) SSBM Finance Inc is a Delaware corporation For information on translations, please e-mail rights@apress.com, or visit http://www.apress.com/ rights-permissions Apress titles may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book's product page, located at www.apress.com/9781484242087 For more detailed information, please visit http://www.apress.com/source-code Printed on acid-free paper To Nancy, Who continues to fill my life with joy and laughter, each day more than the last, and for whom my love grows in kind, each day more than the last Table of Contents About the Author���������������������������������������������������������������������������������������������������xvii About the Technical Reviewer��������������������������������������������������������������������������������xix Acknowledgments��������������������������������������������������������������������������������������������������xxi Introduction�����������������������������������������������������������������������������������������������������������xxv Chapter 1: Relational Databases and Normalization������������������������������������������������ What Is a Relational Database?���������������������������������������������������������������������������������������������������� Entity Relationship Diagrams�������������������������������������������������������������������������������������������������������� Trading Write Speed for Read Speed�������������������������������������������������������������������������������������������� Summary Tables��������������������������������������������������������������������������������������������������������������������������� Structured Query Language���������������������������������������������������������������������������������������������������������� Relational Database Management Systems������������������������������������������������������������������������������� 10 The Binary Search Algorithm������������������������������������������������������������������������������������������������������ 10 Summary������������������������������������������������������������������������������������������������������������������������������������ 11 Chapter 2: Understanding Salesforce’s Data Architecture������������������������������������� 13 Salesforce Database Access������������������������������������������������������������������������������������������������������� 14 SQL vs SOQL and the Data APIs������������������������������������������������������������������������������������������������� 15 DDL vs Metadata API������������������������������������������������������������������������������������������������������������������ 17 Data Types for Type Enforcement and UI Rendering������������������������������������������������������������������� 17 Picklists vs Reference Tables����������������������������������������������������������������������������������������������������� 17 Lookups and Master Detail��������������������������������������������������������������������������������������������������������� 18 Storage Costs������������������������������������������������������������������������������������������������������������������������������ 18 Rollups, Formula Fields, and Views�������������������������������������������������������������������������������������������� 18 v Table of Contents CRUD Fields�������������������������������������������������������������������������������������������������������������������������������� 19 Triggers, Validation Rules, Workflows, and Process Builders������������������������������������������������������ 19 Record Locking��������������������������������������������������������������������������������������������������������������������������� 20 Indexes���������������������������������������������������������������������������������������������������������������������������������������� 21 Salesforce Data Types����������������������������������������������������������������������������������������������������������������� 21 Lookups/Master Detail���������������������������������������������������������������������������������������������������������� 22 Lookup Relationship�������������������������������������������������������������������������������������������������������������� 22 Master-Detail Relationship���������������������������������������������������������������������������������������������������� 22 Record Types������������������������������������������������������������������������������������������������������������������������� 23 AutoNumber�������������������������������������������������������������������������������������������������������������������������� 24 Check Box������������������������������������������������������������������������������������������������������������������������������ 25 Currency�������������������������������������������������������������������������������������������������������������������������������� 25 Date��������������������������������������������������������������������������������������������������������������������������������������� 26 Date/Time������������������������������������������������������������������������������������������������������������������������������ 26 Time (Beta)���������������������������������������������������������������������������������������������������������������������������� 27 E-mail������������������������������������������������������������������������������������������������������������������������������������ 27 Geolocation���������������������������������������������������������������������������������������������������������������������������� 27 Name������������������������������������������������������������������������������������������������������������������������������������� 27 Number���������������������������������������������������������������������������������������������������������������������������������� 28 Percentage���������������������������������������������������������������������������������������������������������������������������� 28 Phone������������������������������������������������������������������������������������������������������������������������������������ 29 Picklist����������������������������������������������������������������������������������������������������������������������������������� 29 Multiselect Picklist���������������������������������������������������������������������������������������������������������������� 30 Text���������������������������������������������������������������������������������������������������������������������������������������� 30 Text Area�������������������������������������������������������������������������������������������������������������������������������� 30 Text Area (Long)��������������������������������������������������������������������������������������������������������������������� 30 Text Area (Rich)���������������������������������������������������������������������������������������������������������������������� 31 Text Encrypted����������������������������������������������������������������������������������������������������������������������� 31 URL���������������������������������������������������������������������������������������������������������������������������������������� 32 Formula Fields����������������������������������������������������������������������������������������������������������������������� 32 Rollups����������������������������������������������������������������������������������������������������������������������������������� 32 vi Table of Contents Owner Id�������������������������������������������������������������������������������������������������������������������������������� 33 Address��������������������������������������������������������������������������������������������������������������������������������� 33 Revisiting our Superhero Data Model����������������������������������������������������������������������������������������� 34 Summary������������������������������������������������������������������������������������������������������������������������������������ 35 Chapter 3: Working the Salesforce Data APIs�������������������������������������������������������� 37 API Limits������������������������������������������������������������������������������������������������������������������������������������ 38 Third-Party ETL Tools and Middleware���������������������������������������������������������������������������������������� 39 Apex Data Loader������������������������������������������������������������������������������������������������������������������ 40 Informatica���������������������������������������������������������������������������������������������������������������������������� 40 SQL Server Integration Services (SSIS)��������������������������������������������������������������������������������� 40 Azure Data Factory���������������������������������������������������������������������������������������������������������������� 41 MuleSoft�������������������������������������������������������������������������������������������������������������������������������� 41 DBAmp����������������������������������������������������������������������������������������������������������������������������������� 41 Relational Junction���������������������������������������������������������������������������������������������������������������� 42 Dell’s Boomi��������������������������������������������������������������������������������������������������������������������������� 42 Jitterbit���������������������������������������������������������������������������������������������������������������������������������� 42 dataloader.io�������������������������������������������������������������������������������������������������������������������������� 43 Scribe������������������������������������������������������������������������������������������������������������������������������������ 43 Open Database Connectivity Drivers������������������������������������������������������������������������������������� 43 The Salesforce Recycle Bin and Data Archiving�������������������������������������������������������������������������� 43 The Salesforce Recycle Bin��������������������������������������������������������������������������������������������������� 43 Data Archiving����������������������������������������������������������������������������������������������������������������������� 44 API Operations���������������������������������������������������������������������������������������������������������������������������� 45 Export������������������������������������������������������������������������������������������������������������������������������������ 46 Export All������������������������������������������������������������������������������������������������������������������������������� 46 Insert������������������������������������������������������������������������������������������������������������������������������������� 46 Update����������������������������������������������������������������������������������������������������������������������������������� 46 Upsert������������������������������������������������������������������������������������������������������������������������������������ 47 Delete������������������������������������������������������������������������������������������������������������������������������������ 47 Hard Delete���������������������������������������������������������������������������������������������������������������������������� 48 vii Table of Contents Undelete�������������������������������������������������������������������������������������������������������������������������������� 48 Merge������������������������������������������������������������������������������������������������������������������������������������ 48 Let’s Give It a Try!������������������������������������������������������������������������������������������������������������������������ 49 Developer Accounts and Sandboxes������������������������������������������������������������������������������������� 49 Log in Salesforce������������������������������������������������������������������������������������������������������������������� 50 Generate a Token������������������������������������������������������������������������������������������������������������������� 51 Download and Install Apex Data Loader�������������������������������������������������������������������������������� 52 Apex Data Loader Settings/API Options��������������������������������������������������������������������������������� 53 Create an External Id������������������������������������������������������������������������������������������������������������� 58 Upsert Accounts�������������������������������������������������������������������������������������������������������������������� 60 Upset Opportunities��������������������������������������������������������������������������������������������������������������� 66 Export Data���������������������������������������������������������������������������������������������������������������������������� 68 Browse through Your data with Workbench and SOQL��������������������������������������������������������������� 71 Summary������������������������������������������������������������������������������������������������������������������������������������ 73 Chapter 4: The Six Attributes of a Good Data Migration����������������������������������������� 75 Attribute 1: Well Planned������������������������������������������������������������������������������������������������������������� 76 Attribute 2: Automated (Redoable)���������������������������������������������������������������������������������������������� 78 Attribute 3: Controlled����������������������������������������������������������������������������������������������������������������� 79 Attribute 4: Reversible����������������������������������������������������������������������������������������������������������������� 80 Attribute 5: Repairable���������������������������������������������������������������������������������������������������������������� 82 Attribute 6: Testable�������������������������������������������������������������������������������������������������������������������� 82 QA: Testing to Specification��������������������������������������������������������������������������������������������������� 83 UAT: Testing for Intent������������������������������������������������������������������������������������������������������������ 83 Summary: A Reminder���������������������������������������������������������������������������������������������������������������� 84 Chapter 5: Attributes of a Good Data Integration��������������������������������������������������� 85 Self-repairing������������������������������������������������������������������������������������������������������������������������������ 86 Planning Differences������������������������������������������������������������������������������������������������������������������� 86 Deployment��������������������������������������������������������������������������������������������������������������������������������� 87 Long-term Support���������������������������������������������������������������������������������������������������������������������� 87 Summary������������������������������������������������������������������������������������������������������������������������������������ 88 viii Table of Contents Chapter 6: Best Practices for Migrating and Integrating Your Data with Salesforce������������������������������������������������������������������������������������������������������� 89 Best Practice 1: Have a Plan������������������������������������������������������������������������������������������������������� 90 Best Practice 2: Review Your Charter and Understand Your Scope��������������������������������������������� 90 Best Practice 3: Partner with Your PM���������������������������������������������������������������������������������������� 91 Best Practice 4: Start Early��������������������������������������������������������������������������������������������������������� 91 Best Practice 5: Understand the Source Data, Ask Questions to Understand Intent, Analyze Data to Know the Reality����������������������������������������������������������������������������������������������� 93 Best Practice 6: Understand the Salesforce Data Model and the Hierarchy������������������������������� 95 Best Practice 7: Document Your Transformations����������������������������������������������������������������������� 95 Best Practice 8: Centralize Your Data Transformations��������������������������������������������������������������� 97 Best Practice 9: Include Source-to-Target Mapping in Transformation Code, Not Just Transformation Logic���������������������������������������������������������������������������������������������������� 97 Best Practice 10: Don’t Hard-code Salesforce Ids; They Change with Environments����������������� 98 Best Practice 11: Store Cross-referenced Data in Salesforce����������������������������������������������������� 98 Best Practice 12: Load Your Data in the Order of the Object Hierarchy��������������������������������������� 99 Best Practice 13: Delete Child Records First, Then Parents, When Deleting Data����������������������� 99 Best Practice 14: Create All Necessary Holding Accounts in Code������������������������������������������� 100 Best Practice 15: Don’t Forget about Owners and Record Types���������������������������������������������� 100 Best Practice 16: Don’t Bury the Bodies; Expose Them������������������������������������������������������������ 100 Best Practice 17: Partner with Your BA������������������������������������������������������������������������������������� 101 Best Practice 18: Automate When Possible������������������������������������������������������������������������������� 103 Best Practice 19: Limit the Number of Intermediaries (Layers of Abstraction)������������������������� 103 Best Practice 20: Use Proper Tools������������������������������������������������������������������������������������������� 104 Best Practice 21: Build a Library of Reusable Code������������������������������������������������������������������ 105 Best Practice 22: Turn off Duplicate Management�������������������������������������������������������������������� 105 Best Practice 23: Have Some Way to Control/Limit Which Data Get Migrated�������������������������� 106 Best Practice 24: Fix Code, Not Data����������������������������������������������������������������������������������������� 106 Best Practice 25: Fix Errors with Parent Objects before Moving on to Children����������������������� 108 Best Practice 26: Modulation Is Also a Form of Control������������������������������������������������������������ 108 Best Practice 27: Every Record You Insert Should Have an External Id������������������������������������ 109 ix Table of Contents Best Practice 28: Standardize External Ids and Always Enforce Uniqueness��������������������������� 110 Best Practice 29: Don’t Use the External Id for Anything Except the Migration or Integration������������������������������������������������������������������������������������������������������������ 112 Best Practice 30: Use Upsert When Possible���������������������������������������������������������������������������� 112 Best Practice 31: Every Record You Insert Should Have a Job Id���������������������������������������������� 113 Best Practice 32: Real Users Must Perform UAT on the Data Migration and You Must Get Sign-off before Going Live���������������������������������������������������������������������������������� 114 Best Practice 33: Plan for an Extended UAT Period������������������������������������������������������������������� 115 Best Practice 34: Build a Relationship with the Users�������������������������������������������������������������� 115 Best Practice 35: QA and UAT is for Testing Processes Too (Not Just Code)����������������������������� 116 Best Practice 36: Start Fresh for Each Round of QA and UAT��������������������������������������������������� 116 Best Practice 37: Log Everything and Keep Detailed Notes������������������������������������������������������ 116 Best Practice 38: Get a New Cut of Data for Each Round of QA and UAT���������������������������������� 117 Best Practice 39: Record Runtimes������������������������������������������������������������������������������������������� 118 Best Practice 40: When Defects Are Found, Patch the Code Then Rerun It������������������������������� 118 Summary���������������������������������������������������������������������������������������������������������������������������������� 119 Chapter 7: Putting It All Together: A Sample Data Migration������������������������������� 121 Project Initiation������������������������������������������������������������������������������������������������������������������������ 121 Design and Analysis������������������������������������������������������������������������������������������������������������������ 124 Salesforce Object Load Order��������������������������������������������������������������������������������������������������� 128 Let’s Get Coding! Set Up����������������������������������������������������������������������������������������������������������� 129 Download Cross-reference Data����������������������������������������������������������������������������������������� 131 Accounts������������������������������������������������������������������������������������������������������������������������������ 136 Account Parent�������������������������������������������������������������������������������������������������������������������� 142 Contacts������������������������������������������������������������������������������������������������������������������������������ 145 Account Contact Relation���������������������������������������������������������������������������������������������������� 150 Tasks and Events (Activities)����������������������������������������������������������������������������������������������� 154 Task and Event Relation������������������������������������������������������������������������������������������������������ 157 Attachments������������������������������������������������������������������������������������������������������������������������ 159 All Done!������������������������������������������������������������������������������������������������������������������������������������ 164 x Index six attributes, 274 source system, 85, 273 SSIS tool, 124 synchronization, 281 target, 273 tools APIs, 277 ETL, 277 middleware, 277 Salesforce connectors, 277 skill set, 277 transformation code, 280 triggers, 277 UAT, 85 upserts, 85 validation rules, 277 workflows, 277 Data quality issues Data.com, 288 Duplicate Management, 288 field-level issues, 287–288 row-level issues, 287–289 triggers, 288 validation rules, 288 workflows, 288 Data source, 291 Data storage, 18 Data structure, 291 Data synchronization, 181, 203 bidirectional, 182–183 data conflicts, 181 incremental delete, 201–202 incremental update, 181 IsDeleted, 202 job, 181 job-level, 181 last-modified date, 202 object level, 181 patterns (see Synchronization patterns) targeted delete, 201 transformations, 181 two-way unidirectional, 183–184 unidirectional, 182 Data types, 17, 21 address, 33 city, 33 country, 33 postal code, 33 state, 33 street, 33 auto numbers, 24 external IDs, 25 system maintained, 25 c, 21 cascades, 22 check box, 25 default value, 25 NULL, 25 required, 25 Child object, 22 currency, 25 Currency Code, 26 Date, 26 Date/Time, 26 deterministic, 33 e-mails, 27 enforcement, 17 formula fields, 32 audit information, 32 cross-object, 32 last modified date, 32 system modified stamp, 32 geolocation, 27 329 Index Data types (cont.) lookup relationship, 22 Master-Detail relationship, 22 multicurrency, 26 multiselect picklist, 30 list boxes, 30 semicolon, 30 Name custom objects, 27 native Salesforce objects, 27 Salesforce Standard Object Developer Documentation, 28 nondeterministic, 33 number, 28 decimal, 28 Owner ID, 33 percentages, 28 phone, 29 picklists, 29 record types (see Record types) referential integrity, 22 related list, 22 reparenting, 23 rollups, 32 children, 32 Lookups, 33 Master-Detail Relationships, 33 space padding, 21 string, 21 text, 30 text area, 30 text area (long), 30 text area (rich), 31 text encrypted, 31, 32 Time (Beta), 27 URL, 32 Vachar, 21 330 Date/Time keywords, 26 Last_Week, 26 middleware, 26 Salesforce connectors, 26 Salesforce data loader, 26 Today, 26 UTC, 26 Yesterday, 26 DBAmp, 41 linked server, 41 metadata, 41 SOQL, 41 stored procedures, 41 Dell’s Boomi, 42 Denormalization, 13, 18 Developer accounts, 49, 54 DeveloperName fields, 134 Differential Synchronization pattern, 282 Differential Upsert-With Periodic Rebuild pattern, 199, 209 cons, 200 pros, 199–200 rebuild, 199 Differential Upsert-With Targeted Delete pattern, 195 coalescing, 197 cons, 198 data type, 197 false positives, 197 field-level compare, 196 full-load, 197 multiselect picklists, 197 NULL, 197 perform, 196 SQL, 196 Disk space, 18 Index Druva, 276 Dupe-blocker, 105 Duplicate detection algorithm data matching artificial key, 290 natural key, 290–298 data quality issues, 287–289 Duplicate management, 105, 278, 287, 288, 315 E E-mails, 17 external IDs, 27 hyperlinks, 27 uniqueness, 27 Email-to-Case, 238 e-mail address, 226 e-mail servers, 226 Embedded iFrame, 239 account name, 231 account page, 231 app, 231 HTML, 231 URL, 231, 232 web page, 231 Encrypted fields, formulas and rollups currency field, 210 decimals, 211 decrypt, 209 formatting, 209 front-end validation, 210 left-padded, 211 party options, 209 spaces, 211 text as currency, 210 type, 209 Encrypted text field, 210 Encrypting data, 209 End-of-month (EOM), 217 Enterprise Application Integration (EAI), 228 Enterprise Service Bus (ESB), 228 Entities, Entity relationship diagrams (ERDs), 7, 93, 95 ERP system, 203 Error handling, 169 job-level errors, 169–171 row-level errors, 169, 171–177 ETL-based rollups and formula, 207 pattern flow, 208 real time, 208 trigger, 208 Event relation, 128 EventRelation object, 157 Exact transform load (ETL) tools, 39, 97, 125, 207, 238 adaptors, 39 Apex Data Loader, 40 Azure Data Factory, 41 best practice, 284 code, 39 connectors, 39 csv, 39 dataloader.io, 43 DBAmp, 41 Dell’s Boomi, 42 Informatica, 39–40 Jitterbit, 42 job ID, 284 MuleSoft, 41 ODBC drivers, 43 Relational Junction, 42 Scribe, 43 SOQL, 284 331 Index Exact transform load (ETL) tools (cont.) SSIS, 40–41 time integrations, 39 user, 284 “where” clause, 284 External IDs, 98, 109 account, 58 API name, 59 auto number, 110 case insensitive, 59 composite key, 109 concatenation, 109 Contact object, 111 description, 59 duplicates, 110 Field Name, 59 Fields & Relationships, 58 gear icon, 58 Help Text, 59 indexed, 109 inserts, 110 length, 59 natural key, 109, 112 navigation bar, 58 New Custom Field, 59 Object Manager, 58 opportunity, 58 PK, 109 prefix, 111 record identifier, 110 row, 109 search box, 109 setup, 58 surrogate key, 112 unique, 59 unique identifier, 109 uniqueness, 110 upsert, 58, 109 332 F FAT application automation, 239 automation library, 233 class libraries, 233 hard drive, 233 thick, 233 thin, 233 web browser, 233 Field-level data quality issues cleanup, 288 fix code not data, 288 formatted, 288 library of reusable code, 288 sparsely populated, 288 transformations, 288 File attachments (Salesforce content) deletes, 211 inserts, 211 pattern flow, 212 Firewall, 123 First normal form, 2–3 Flat files, 207 Foreign key (FK), 18, 289 Formula fields, 18 G Globally unique identifier, 290 Google Cloud, 230 Google Cloud Functions, 230 Google Cloud Platform, 230 Google Cloud Pub/Sub, 230 Governor limit errors, 174 cascading deletes, 174 data model, 174 storage space, 174 Index H Half-interval search, 10 Heroku, 229 Holding account, 138 Hyperlink, 230, 239 Hyper Text Transfer Protocol (HTTP), 15 I Incremental Date-based Upsert pattern, 208, 211 Incremental Date-Based Upsert-With Targeted Delete pattern, 192 attribute, 195 clock synchronization, 192 database administrator, 194 daylight savings time, 192 joins, 194 logic, 194 middleware, 192 Salesforce administrator, 195 self-repairable, 195 stored, 194 timestamp, 192 time zone conversion, 192 value, 192 Indexes, 21 audit dates, 21 external ID, 21 FKs, 21 lookup, 21 master-detail, 21 PKs, 21 unique fields, 21 Informatica, 40, 228 Informatica Cloud, 276 Integrate systems, 203 Integration patterns, 203, 287, 306 International Standards Organization (ISO), 26 J Java Database Connectivity (JDBC), 104 Jitterbit, 42 Job-level errors, 169 bulkifying triggers, 177–178 connectivity, 169 connectivity issues, 170 database or Salesforce schema, 169 data integrations, 170 data migrations, 170 development environment, 170 environment stability, 170 ETL tool, 169 log, 170 middleware, 169 network outage, 169 production run, 170 Salesforce schema, 171 self-repairing, 170 stored procedure, 171 support, 170 testing, 170 UAT, 170 UDF, 171 user password, 170 K Kingsway adaptor, 163 KingswaySoft connector, 124, 132, 135, 242 333 Index L LastModifiedById field, 19, 33 LastModifiedDate field, 19, 33 LatestPublishedVersion, 161 Layers of abstraction, 103 csv, 103 ETL tool, 103 Excel, 103 leaky abstractions, 103 MS SQL Server, 103 NULL, 103 text formatting, 103 Legacy IDs back end, 274 comparing data, 274 defect, 274 querying, 274 repairability, 274 searching, 274 testability, 274 transformations, 274 UI, 274 wipe and load, 274 Legacy keys, 214 Library of reusable code, 125 best practices, 241 centralize, 241 code quality, 241 code reuse, 241 consulting, 241 ETL, 241 integration, 241 middleware, 241 migration, 241 MS SQL Server, 241 professional services, 241 RDBMSs, 241 reusable, 241 334 SQL, 241 SQL function, 241 transformation code, 241–242 T-SQL, 241 UDFs, 241 Lighting component, 210 Local database, 207 Logic Apps, 229 Lookups, 18 M Many-to-many relationships, 215 Mapping document, 127, 136 Marketing campaigns, 204 Master data management (MDM), 205 Master Details, 18 Master system, 182 Message queue, 229 Metadata API, 17 Microsoft Azure, 229 Middleware, 39, 97, 125, 207 Migrate, 287 Migration, 287 MS SQL Server, 18, 241, 291 MuleSoft, 41 integration cloud, 41 Multiselect picklists, 17, 148, 215, 252, 261 Multitenancy, 14 N Native apps, 231, 239 Natural keys address, 298 Contact, 291 ContactID, 291 Contact Record, 295 credit card number, 290 Index driver’s license ID, 290 e-mail address, 290 enrich, 298 home phone, 296 identify, 290 inner join, 297 KeyName, 291 KeyValue, 291 Lead, 291 mobile phone, 296 name, 290 nickname, 298 normalizing address information, 298 order processing system, 298 phone number, 290 product SKU, 290 query, 297 record identification, 290 Select statement, 294 Social Security number, 290 sounds like, 298 SQL joins, 297 tax IDs, 290 UDFs, 294 unioned, 294 US Postal Service, 298 weight score, 298 Network drive, 207 Network operations center (NOC), 86 Normalization, 18 NoSQL, Numeric data types, 209 O Object hierarchy, 128 Object load order account contact relation, 128 account parent, 128 accounts, 128 activities, 128 attachments, 128 batches, 128 contacts, 128 control, 128 events, 128 holding account, 128 onboard, 128 tasks, 128 timeline, 128 user ID, 128 users, 128 Odaseva, 276 One-to-many relationships, 5, 148 One-to-one relationship, Open database connectivity (ODBC) drivers, 43 Opportunity/pipeline management, 204 Optimistic locking, 20 Oracle, 14, 18, 103 Outbound e-mails, 221, 227 SOA middleware, 228–230 Web service triggered ETL, 227–228 OwnBackup, 276 P Performance tuning, 21, 169, 178 cross-reference data, 178 optimization, 179 parallelize, 179 remote lookups, 178 sort, 179 Picklists, 17 API, 29 combo box, 29 deactivate, 29 drop-down lists, 29 335 Index Picklists (cont.) error, 29 hierarchy, 29 inactive value, 29, 277 insert, 29 restricted, 29 transformation layer, 277 update, 29 Platform encryption, 32, 209 Platform events, 225, 238 API, 224 c, 224 e, 224 trigger, 224 PL-SQL, Presales activity, 204 Primary key (PK) index, 131, 289 Process builders, 19 Production Orgs, 54 Program manager (PM), 84 Project conception, 121 Project documentation, 121 Project initiation activities, 122 ASP, 123 backlog, 121 campaigns, 122 cases, 122 file attachments, 123 implementation partner, 121 opportunities, 122 PM, 122 project plan, 121 SOW, 122 users, 122 Project manager (PM), 76 336 Q Quality assurance (QA), 78, 83, 91, 117–118 Quick Find, 50 R Real-time data integrations, 219–220, 306–307 Apex callout, 221, 225 Apex e-mail service, 221, 226 Apex web services, 221, 225 batch integrations, 219 Email-to-Case, 221, 226 platform events, 221, 224 Salesforce APIs, 220–222 Salesforce Connect, 220, 222–223 Salesforce outbound messaging, 221, 223 service-level agreement, 219 SOA middleware, 221 Streaming API, 221, 224 Web service triggered ETL, 221 Web-to-Case, 221, 226 Web-to-Lead, 221, 226 Record locking, 20–21 Edit button, 20 Record locking errors, 174 batches, 175 Bulk API, 175 business rules, 176 contacts, 174 development team, 176 ETL tool, 175 junction object, 176 locks, 175 lookups, 176 Index lookup skew, 177 Master-Detail, 176 nonrequired lookups, 176 parallel batches, 175 parent accounts, 174 premature optimization, 177 queries, 177 required lookups, 176 Salesforce SA, 176 serial processing, 175 SOAP API, 174 Record Merge activities, 205 API, 205 archive, 206 clean up, 206 download, 205 duplicate records, 205 identify, 205 merge, 206 reparent, 205 synchronizing data, 205 tagging, 207 transformed dataset, 205 Record not found error, 204 Record types, 23, 98, 133, 204 case sensitive, 23 15-character IDs, 23 18-character IDs, 23 Excel, 23 RecordtypeId, 23 Recycle bin formula, 43 IsDeleted, 44 locking, 44 restore, 43 rollups, 43 soft delete, 43 SOQL, 44 triggers, 43 Reference tables, 17 Relational database management system (RDBMS), 10, 13, 94, 241 Relational databases, 1, 13–14, 252, 289 data anomalies, data integrity, 2, data model, denormalizing, 1, foreign key, keys, 14 many-to-many relationship, normalization, 2, one-to-many relationship, one-to-one relationship, parent and child, primary key, relationship or joins, self-relationships, superheroes dataset, 3–4 Relational Junction, 42, 276 Asure, 42 DB2, 42 delete, 42 Informix, 42 insert, 42 Linux, 42 MySQL, 42 Oracle, 42 PostgreSQL, 42 restore delete, 42 SQL Server, 42 Sybase, 42 Unix, 42 update, 42 Reporting snapshots, 216 337 Index Representation State Transfer (REST) API, 15, 38 Rollup fields performance, 18 Row-level data quality issues automated, 289 build-or-buy decision, 289 custom-build, 289 duplicate detection, 289 duplicate records, 288 invalid records, 288 missing records, 288 orphaned, 288 product vendors, 289 simple and effective algorithm, 289 transformation layer, 289 Row-level errors, 169, 171 error code, 172 error message, 172 external ID, 172 Governor limit errors, 172, 174 Individual Object Error Log, 171 object name, 172 record locking errors, 172, 174 Salesforce code errors, 172–173 Salesforce ID, 172 Salesforce validation errors, 172 Runtime, 18 S Sales activities, 204 Salesforce APIs, 169, 220–221, 231, 237 C#, 221 clicks not code, 19 database access, 14–15 data types (see Data types) destination screens, 140 338 developer, 210 Duplicate Management, 278 Java, 221 JavaScript/jQuery, 222 object’s data model, 213 Python, 222 reporting, 216 system, 95 Salesforce code errors, 172 Clicks not code, 173 data API, 173 data migrations, 173 developer, 173 insert, 173 integration, 173 Process Builder, 172 release policies, 173 things, 173 triggers, 172 update, 173 use case, 173 workflows, 172 Salesforce Connect, 237 custom adapter, 222 custom object, 222 external data source, 222 external object, 222 oData, 222–223 RDBMS, 222 real time, 222 SOQL, 222 source/target, 222 update data, 222 web service call, 222 Salesforce connectors, 97, 124, 277 Salesforce Object Query Language (SOQL), 15 delete, 15 Index insert, 15 update, 15 Salesforce outbound messaging, 223, 237 automatic retries, 223 endpoint, 223 wsdl.exe, 223 Salesforce Shield, 32, 209 Salesforce UI, 14, 17, 20, 22, 37, 50, 109, 220, 226, 274 Salesforce validation errors, 172 data types, 172 field validation, 172 QA, 172 required fields, 172 restricted picklists, 172 testing, 172 transformation code, 172 Sandbox, 49, 54, 276 Save Button, 20 SC-CRM contact table, 147 SC CRM ID, 129 Scribe, 43 Second normal form, 3–4 Sequence container, 133, 154, 156, 158, 161, 164 Service bus, 229 Service-level agreement, 219 Service-oriented architecture (SOA) middleware, 229–230, 239 APIs, 228 AWI, 229 connectors/adapters, 228 EAI, 228 ESB, 228 service layers, 228 Simple Object Access Protocol (SOAP) API, 15, 37, 56, 134, 174 delete, 37 insert, 37 synchronous, 37 update, 37 SobjectType, 134 Source database, 138 Spanning Backup, 276 SQL Server, 123 SQL Server Integration Services (SSIS), 40 C#, 40 CozyRoc, 41 KingswaySoft, 40 MS, 40 option, 40 Salesforce Connectors, 40 TaskFactory, 41 SQL Server target, 133 Staging database, 127, 138 Statement of work (SOW), 90, 122 Stereotype Content Model, 115 Storage cost, 18 parent table, 18 Storage space, 49 Streaming API, 224, 237 deleted, 224 inserted, 224 listeners, 224 push notifications, 224 updated, 224 Structured Query Language (SQL), 9, 241 attributes, 15 data type, 15 DCL, DDL, DML, join criteria, 15 vs SOQL and data APIs, 15–16 task, 132 339 Index Structured Query Language (SQL) (cont.) transformations, 125 view, 136 Subject matter expert (SME), 77 Superhero data model, 34 Surrogate key, 290 Surviving record, 205 Survivor record, 205 Synchronization patterns, 85, 184, 203, 304–305 audit field, 191 Basic Upsert-No Delete pattern, 85, 185–186 Basic Upsert-With Targeted Delete pattern, 189–190 differential approach, 185, 201 differential-load patterns, 191 Differential Upsert-With Periodic Rebuild pattern, 198–200 Differential Upsert-With Targeted Delete pattern, 195–198 full-load patterns, 185, 191 incremental approach, 185, 201 Incremental Date-Based Upsert-With Targeted Delete pattern, 192–195 incremental-load patterns, 191 performance tuning, 191 transformation layer, 184 use case, 184 Wipe and Load pattern, 186–188 Sync patterns, 205 System Handoff (prospect conversion) billing, 204 catch/log, 204 client, 204 CRM systems, 204 external ID, 204 340 handover, 204 Lead, 203–204 order, 204 ownership, 204 PK, 204 prospecting, 204 self-repairing, 204 system of record, 203 updates, 204 upserts, 204 System limitations, 287 SystemModStamp field, 19 T Task relation data flow, 158 TaskRelation object, 157 TCP/IP, 15 Third normal form, 3–4 Time series backups (time-based snapshot) as-of date, 216 current data, 217 Data Archive pattern, 216 EOM calculations, 217 EOM data, 217 EOM snapshot, 217 last day, month, 217 leap-year, 217 monthly snapshot, 217 timestamp field, 216 Transformation code, 106 HTML tags, 107 line breaks, 107 plain text, 107 rich text, 107 staging area, 107 validation, 107 Index Transformations, 95, 105 e-mail, 105 HTML, 105 line breaks, 105 phone numbers, 105 special characters, 105 Trigger mechanism, 204 Triggers, 19 deleted, 19 inserted, 19 updated, 19 T-SQL, 9, 241, 281, 291 Two-way unidirectional synchronization lead, 183 mailing addresses, 184 ownership, 183 prospect conversion, 183 U Upsert accounts Apex Data Loader, 60 choosing field, 62 data objects, 61 Finish screen, 65 mapping screen, 63–64 OwnerID, 63 Password Authentication, 60 token, 60 Username, 60 URL, 255 User acceptance test (UAT), 78, 82–84, 117–118, 170 PM, 84 QA analysts, 83 testing for intent, 83 testing to spec, 83 User-defined functions (UDFs), 139, 241, 294 base64, 242 binary file, 242 e-mail address, 242 file paths, 242 fn_Base64Decode database, 243 file system, 243 fn_Base64Encode attachments, 242 binary data, 242 KingswaySoft connector, 242 fn_CamelCase camel case, 244 lowercase, 244 uppercase, 244 fn_Convert15CharIDTo18, 246–247 18-character ID, 245 15-character Salesforce ID, 245 fn_Fix_Invalid_XML_Chars, 249 bad records, 247 XML, 247 fn_Format_for_ContentNoteText, 252 ContentNote, 251 ContentNote.content, 251 HTML tag, 251 fn_FormatPhone, 250 e-mail addresses, 249 format, 249 phone numbers, 249 fn_GetAccountAggregation, 253 concatenate, 252 multiselect picklists, 252 one-to-many child table, 252 picklist, 252 relational database, 252 semicolon-delimited string, 252 341 Index User-defined functions (UDFs) (cont.) fn_GetAddressLines, 254–255 address, 253 multiline text field, 253 fn_GetDomain, 256 domain, 255 URL, 255 fn_GetFileExtension, 257 extension, 256 fn_GetNamePart, 259 contact name, 258 FirstName, 258 LastName, 258 MiddleName, 258 name part, 258 fn_GoodEmailorBlank, 261 contact, 259 e-mail, 259 insert, 259 invalid e-mail addresses, 259 update, 259 upsert, 259 validating e-mail addresses, 259 fn_MultiSelect_DedupAndSort, 261 multiselect picklists, 261 synchronization patterns, 261 fn_RemoveNonNumeric, 265 driver’s license numbers, 265 non-numeric characters, 265 phone numbers, 265 Social Security numbers, 265 fn_StripHTML, 264 formatting, 262 plain text field, 262 fn_StripNonAlphaNumeric Characters, 264 characters, 264 letters, 264 342 numbers, 264 PK, 264 fn_StripSpaces, 265 fn_TextToHTML, 266 line breaks, 266 plain text, 266 rich text field, 266 format phone, 242 name parts, 242 picklist, 242 rfn_GetFileFromPath file name, 257 full file path, 257 sp_GetDirTree, 268, 270–271 account name, 267 directory, 267 stored procedure, 267 subdirectories, 267 User interface (UI), 14, 17, 20, 22, 37, 50, 109, 220, 226, 274 V Validation code, 19 Validation rules, 19 Victim record, 205 Virtual private network (VPN), 15 VLookups, 104 W Web browser automation, 235, 240 CAPTCHA, 235 object model, 234 Web browser extensions, 235, 240 Firefox, 236 Google Chrome, 236 Index Internet Explorer, 236 Microsoft Edge, 236 mobile browsers, 235 Opera Explorer Edge, 236 Safari, 236 Web service, 13 Web service triggered ETL, 221 configurations, 227 control, 227 Dell Boomi, 228 Informatica, 228 Jitterbit, 228 middleware, 227 patterns, 227 Scribe, 228 Web-to-Case, 226, 238 case, 226 HTML, 226 Salesforce UI, 226 triggers, 226 web form, 226 web site, 226 workflows, 226 Web-to-Lead, 238 campaign, 226 lead, 226 Windows automation, 236, 240 Wipe and Load pattern, 186 cascading deletes, 187 data loss, 188 deleted in source, 187 failures, 187 flag, 187 full delete, 188 full load, 188 history, 188 lock, 188 offline, 187 outdated data, 188 soft delete, 187 system outage, 188 truncated, 187 Workbench, 71 developer, 72–73 documentation, 72 sandbox, 71 SOQL, 71, 72 Workflows, 19 X, Y, Z XML, 247 343 .. .Developing Data Migrations and Integrations with Salesforce Patterns and Best Practices David Masri Developing Data Migrations and Integrations with Salesforce: Patterns and Best Practices. .. low-maintenance, high-performing data migrations and integrations with Salesforce The book covers the patterns and best practices needed to build migrations and integrations the right way Who... about data migrations and integrations One is that data migrations and integrations are two very different things Another is that data migrations are somehow easier to build A third is that data

Ngày đăng: 01/03/2019, 21:45

Từ khóa liên quan

Mục lục

  • Table of Contents

  • About the Author

  • About the Technical Reviewer

  • Acknowledgments

  • Introduction

  • Chapter 1: Relational Databases and Normalization

    • What Is a Relational Database?

    • Entity Relationship Diagrams

    • Trading Write Speed for Read Speed

    • Summary Tables

    • Structured Query Language

    • Relational Database Management Systems

    • The Binary Search Algorithm

    • Summary

    • Chapter 2: Understanding Salesforce’s Data Architecture

      • Salesforce Database Access

      • SQL vs. SOQL and the Data APIs

      • DDL vs. Metadata API

      • Data Types for Type Enforcement and UI Rendering

      • Picklists vs. Reference Tables

      • Lookups and Master Detail

      • Storage Costs

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan