As businesses rely more heavily on Salesforce, teams developing on the platform are faced with higher demand. Many Salesforce teams are turning to DevOps practices to meet business requirements, because DevOps helps them deliver work quickly, efficiently and safely.
DevOps is growing in popularity in the Salesforce ecosystem, but for many teams it’s still a new concept. Read on for a quick overview of DevOps, and some guidance on how you can get started.
What is Salesforce DevOps?
‘DevOps’ is a set of practices designed to help teams build, test, and release software faster and more reliably. It stems from the need to combine the responsibilities of both software development teams (‘Dev’) and operations teams (‘Ops’).
For Salesforce, this means bringing together the people responsible for building applications (developers and admins) and the people responsible for releasing, monitoring and maintaining those applications (typically admins, team leads or release managers).
When the responsibility of releasing software is shared across the whole development team, there are fewer silos and the team can communicate and collaborate more effectively.
DevOps is also about a new approach to development and releases—it aims to make release cycles faster, more secure and less error-prone. This is partly achieved by incorporating the philosophy of agile development: releasing changes incrementally and regularly adding improvements, rather than releasing once at the end of a big project. And DevOps also relies heavily on automation to shorten the release cycle, by replacing fragile manual processes with repeatable, reliable ones.
The benefits of DevOps
Although relatively new to Salesforce, DevOps has long been established as the best way of creating and managing software on other platforms and software stacks—so it isn’t some new and unproven invention, but an approach that has well-documented benefits.
The whole purpose of DevOps is to increase the ability of teams to deliver new features and solve critical issues quickly and with confidence. So it’s no surprise that high-performing teams who use DevOps are also the ones that achieve:
- A higher frequency of new releases to production
- Shorter lead times for making changes and developing new features
- Fewer bugs and fewer service disruptions due to poor quality code
- Faster restore times in the event of service outages
In fact, the 2021 report from Google’s DevOps Research and Assessment program (DORA) found that elite teams release 973 times more frequently than low-performing teams. High-performing teams also have a lead time from commit to deploy that is a whopping 6570 time faster than low performers, and their changes are 1/3 less likely to fail.
And we’re seeing similar trends among teams developing on Salesforce. Our industry report shows that teams with the highest performance metrics all have mature DevOps processes in place. This allows them to release at least once a day, have a change failure rate of under 10%, and restore lost data within a few days.
Teams adopting DevOps practices with Gearset have a 92% success rate when releasing to production, and can release up to 12x faster than when they deployed with change sets. In short, teams that have adopted DevOps practices dramatically outpace those that haven’t.
What does DevOps involve?
DevOps involves certain tools, processes and ways of working. Luckily, adopting DevOps for Salesforce doesn’t necessarily mean you have to make lots of changes all at once. Taking just one step towards a more agile development process can reap rewards. Your team might already be doing some things that are part of DevOps!
In general, a robust DevOps strategy will include practices such as version control, continuous integration, automated testing and backup.
Pillar 1: Version control for faster, more reliable development and collaboration
A Git-based version control system (VCS), or ‘source control’, is at the heart of any modern DevOps process. Source control allows your team to track all the changes you make and easily review your contributions, while making it possible for multiple contributors to work on the same features at the same time. Individual developers contribute new work within Git branches, which are later merged into the master branch—containing the latest and stable version of the project—once the work has been reviewed.
There are countless reasons and benefits to using a version control system like Git. Among many other things, it helps you:
- Reduce risk and avoid costly mistakes by making Git the source of truth for your development team instead of your production org
- Track and annotate your development work with a complete history of every change your team makes to your org—to help your auditing and debugging
- Collaborate with multiple team members working in the same org without overwriting each other’s work or treading on each other’s toes
- Release reliably and safely by testing your changes first until you’re satisfied they’re fit for purpose
Find out more about Git from the free DevOps Launchpad courses: version control fundamentals and Git branching strategies. There’s also loads more detail in our whitepaper on version control for Salesforce.
Pillar 2: CI/CD for rapid, continual added value without manual repetition
Continuous integration (CI) often builds on a Git-based workflow and automates the process of testing and validating changes, making sure they can be deployed. Continuous delivery (CD) is about releasing frequent, small changes to users via an automated process and reducing the risks associated with big releases.
Taken together, CI/CD takes the pain and risk out of repeatedly deploying changes manually to multiple development environments and on to production. It promotes an iterative and incremental approach to development, where you aim to contribute frequent small changes and get immediate feedback from your team and end users. Using CI/CD to make regular, small and automated releases helps you:
- Avoid manual errors causing problems with releases
- Reduce the risk of individual releases as your process becomes ever more reliable
- Reduce downtime by quickly rolling back mistakes and unwanted changes
- Tighten the feedback loop and allow your users to drive your development process
- Work on multiple projects simultaneously and change direction in response to feedback without losing the existing work
- Release the value you’ve created to your users as fast as possible
Learn more about CI/CD in the free DevOps Launchpad course, CI/CD for Salesforce.
Pillar 3: Automated testing for bug-free, clean code that you can rely on
Testing is an integral part of software development, and Salesforce makes developers test at least 75% of any new code they deploy to a production org. But the tests that you write need to be useful and meaningful tests if you want to make sure your team can easily review and reliably build on your code in future.
Automation can help you by testing changes every time they are merged into your master branch and/or deployed to another environment. An agile DevOps setup will also let you populate development or testing environments with data from production, so you can check your code works with actual data—real data that will come in all sorts of shapes that you might not have thought about when you started writing your code. Automated testing allows you to:
- Save time and effort by making sure your changes work properly and can be deployed
- Avoid shipping faulty code and causing existing functionality to break
- Make sure you’re developing the precise features that your organization needs with user acceptance testing
- Improve the quality of your development work by reducing bugs and critical issues, freeing up your team to work on those great new features
Pillar 4: Backup for swift and complete disaster recovery
A backup of your customer and organization’s data is essential in case a disaster strikes—whether it’s accidental data loss, data corruption due to a third-party integration, malicious actions of disgruntled employees, or even a Salesforce platform outage.
Key here is the relationship between your data and the structure of your org—the metadata in which your data is stored. You need continual backups of both your data and metadata. Teams that have tools and processes in place to monitor and roll back changes to their data and metadata are then also in a position to restore complex data hierarchies to their orgs quickly before too much damage is done. In short, a smart backup solution will allow you to:
- Monitor your org’s data for changes or deletions along with metadata monitoring
- Use your familiar deployment process to restore data and metadata
- Deploy backup data to sandbox environments for testing
- Mask and delete records to comply with data protection regulations
For a detailed guide to backing up and restoring your Salesforce org, read our free backup ebook.
Where to start with Salesforce DevOps
It’s best to adopt DevOps processes gradually and improve incrementally, rather than trying to do everything at once. Moving away from change sets and adopting version control are the first steps you can take to improve your release process. Implementing backup early also guarantees the safety of your org while you begin making other changes to your workflow.
While every team will adopt DevOps differently, we’ve set out a rough guide to the ‘stages’ of Salesforce DevOps in our maturity matrix factsheet. It’ll show you some common steps that teams take to build up their DevOps maturity incrementally. You can also take the free maturity assessment to find out how advanced your practices are and benchmark your current performance.
Gearset can remove a lot of the complexity of DevOps, and make it really easy for you to adopt each of the DevOps practices one at a time—as soon as your team is ready to take the next step. You can book a consultation with a DevOps expert about how to improve your development practices with Gearset.