Slide 1

Slide 1 text

Elevate Your DevOps: How Scratch Orgs Pools Fit Into Your Salesforce Strategy By Jérémy Vial & Nathan Abondance

Slide 2

Slide 2 text

Developer, Texeï Jérémy Vial Salesforce Tech Lead, Aviv Group Nathan Abondance

Slide 3

Slide 3 text

Agenda 1. Context 2. Theoretical Solution 3. Practical Solutions 4. Diving deeper in the open source solution 5. Integration to existing development cycle 6. Future proof 7. Summary

Slide 4

Slide 4 text

Context

Slide 5

Slide 5 text

What are Scratch Orgs •Environment for Source-driven deployment of Salesforce metadata and data •Fully configurable •Allowing to emulate different Salesforce editions, features and settings •Scratch org configuration file

Slide 6

Slide 6 text

What are Scratch Orgs •Environment for Source-driven deployment of Salesforce code and metadata •Fully configurable •Allowing to emulate different Salesforce editions, features and settings •Scratch org configuration file •Install packages and deploy data for testing •Representate by SObject in the DevHub

Slide 7

Slide 7 text

x What’s copied Data Storage Refresh Cycle Sandbox Template Quantity Scratch org Customisable Metadata Data: 200MB File: 50MB x Not available Essential: 3 Professional: 40 Enterprise: 100 Unlimited: 100 Developer (sandbox) Metadata only Data: 200MB File: 200MB 1 Day Not available Essential: 10 Professional: 25 Enterprise: 100 Unlimited: 100 Developer Pro (sandbox) Metadata only Data: 1GB File: 1GB 1 Day Not available Essential: 0 Professional: 0 Enterprise: 5 Unlimited: 5 Partial (sandbox) Metadata & Sample data Data: 5GB File: 5GB 5 Days Required Essential: 0 Professional: 1 Enterprise: 1 Unlimited: 1 Full (sandbox) Metadata & all data Same as Production 29 Days Available Essential: 0 Professional: 0 Enterprise: 1 Unlimited: 1

Slide 8

Slide 8 text

Work with a Scratch Org

Slide 9

Slide 9 text

Scratch org creation Create the scratch org

Slide 10

Slide 10 text

Scratch org push metadata Push on the scratch org

Slide 11

Slide 11 text

Scratch org retrieve Retrieve metadata on the scratch org

Slide 12

Slide 12 text

Scratch org push data Push and retrieve data scratch org 1. vanilla sf command sf data import tree --files Contact.json,Account.json --target-org my-scratch 2. sf plugin (texeï, sfdmu) 3. data package 4. ISV 5. API

Slide 13

Slide 13 text

Usage of Scratch Org

Slide 14

Slide 14 text

Development •Highly and easily customisable •Isolated and Ephemeral Environment •Quick to Create (empty) and Delete •Reduces Code Conflicts (dev workflow more accurate) •Conformity with Production Environments

Slide 15

Slide 15 text

Tests •Clean Testing Environment •Facilitates Continuous Integration/Continuous Deployment (CI/CD) •Promotes Agile Development Practices •No Long-Term Commitment (can test new feature not in prod) •Replicates Production Environment

Slide 16

Slide 16 text

Limits with advanced usage •Manual creation •Time consuming •Config •Competence (scripting) •Max SO available ( /devhub)

Slide 17

Slide 17 text

How to address those painful point ?

Slide 18

Slide 18 text

The solution

Slide 19

Slide 19 text

Theoretical Solution

Slide 20

Slide 20 text

Theoretical solution: the pool

Slide 21

Slide 21 text

Theoretical solution: the concept Pool of Scratch orgs Pre-created On-demand Fast Recycling Up-to-date

Slide 22

Slide 22 text

Theoretical solution: pool refilling pool logic Pool 1 Pool 2 Check empty slots Check empty slots Legend Existing SO Empty slot

Slide 23

Slide 23 text

Theoretical solution: pool refilling Pool 2 Legend Existing SO Empty slot Created SO Refill empty slots pool logic Pool 1

Slide 24

Slide 24 text

Pool 2 Pool 1 Theoretical solution: pool recycling Legend Existing SO Empty slot Used SO pool logic Delete unused Scratch Orgs Delete unused Scratch Orgs

Slide 25

Slide 25 text

Theoretical solution: advantages • Automatic • Available on demand instantaneously • No competence needed to use it • Specific pools for specific use cases

Slide 26

Slide 26 text

Theoretical solution: You will be like that

Slide 27

Slide 27 text

Practical Solutions

Slide 28

Slide 28 text

Practical Solution: Paying tool Exemple: Hutte CONS Cost money Limited customization Dependency on Vendor Easy to setup PROS Handle basic use cases User friendly interfaces

Slide 29

Slide 29 text

Practical Solution: Do It Yourself CONS Time consuming Reinventing the wheel Facing challenges alone Free PROS Highly customizable Skill development

Slide 30

Slide 30 text

Practical Solution: Open Source Exemple: sfp by flxbl Best of booth previous solutions PROS Maintained by the community Flexibility and Innovation CONS Dependency on community Learning curve Integration challenges

Slide 31

Slide 31 text

Diving deeper in the open source solution

Slide 32

Slide 32 text

What do we need ? ● Logic to create and manage pools ○ data management (data package , sfdmu, script texei or commande sf) ○ metadata management (metadata in repo ou package) ● using packages deployment strategy highly recommended ● CI/CD / VM / raspberry ● a git repository

Slide 33

Slide 33 text

Integration to existing dev cycle

Slide 34

Slide 34 text

Integration to existing dev cycle Example of workflow with sfp CI Pool Dev Pool ● All dependencies installed ● Use for testing deployment ● Deleted after use to avoid corrupted metadata => Ready to use ● External dependencies installed ● Custom code deployed ● Data samples ● User configuration

Slide 35

Slide 35 text

Integration to existing dev cycle Example of workflow with sfp CI Pool main feature branch PR review if test deploy in SOCI OK = merge developement

Slide 36

Slide 36 text

Integration to existing dev cycle Example of workflow with sfp Dev Pool SO feature A SO feature B sfp pool:fetch --tag=devpool

Slide 37

Slide 37 text

Integration to existing dev cycle Example of workflow with sfp Replenish CI Pools - Auto Triggered pool logic Replenish Dev Pools - Auto Triggered Scratch Org Pool Cleaner - Auto Scheduled Scratch Org Recycler - User Scheduled 🗑

Slide 38

Slide 38 text

Future proof

Slide 39

Slide 39 text

Future proof: What is the future ? • Packages • Multiple orgs • More customization options • Real data in dev environments • Huge orgs

Slide 40

Slide 40 text

Future proof: Good news • Packages ✅ • Multiple orgs ✅ • More customization options ✅ • Real data in dev environments ✅ • Huge orgs ✅

Slide 41

Slide 41 text

Summary

Slide 42

Slide 42 text

Summary • Game changer • Central in your devops strategy • Can evolve with your devops

Slide 43

Slide 43 text

Working demo: ftd23 Our GitHubs: Jérémy: /jeremyvial Nathan: /nabondance Thank you We are looking for a senior Salesforce developer at

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Images rights - Newton the cat, Nathan Abondance, 2023. - We Can Do It!, J. Howard Miller, 1943. - AI generated images, DALL-E, 2023. - Hutte logo, Hutte GmbH, 2023. - Flxbl logo, Flxbl, 2023. - Aviv logo, Aviv Group GmbH, 2019.